util

package
v0.0.0-...-738e6fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_WINDOW_SIZE uint32 = 64 * 1024

When a SPDY connection is first established, the default initial window size for all streams is 64KB.

Variables

View Source
var ErrWindowOverflow = errors.New("Window overflow")

Functions

This section is empty.

Types

type BlockingPriorityQueue

type BlockingPriorityQueue struct {
	// contains filtered or unexported fields
}

func NewBlockingPriorityQueue

func NewBlockingPriorityQueue(size uint32) *BlockingPriorityQueue

func (*BlockingPriorityQueue) Pop

func (*BlockingPriorityQueue) Push

func (bq *BlockingPriorityQueue) Push(item PriorityItem)

type FlowCtrlWin

type FlowCtrlWin struct {
	L sync.Mutex
	// contains filtered or unexported fields
}

FlowCtrlWin is the implementation of SPDY Flow Control Window for sending.

func NewFlowCtrlInitSize

func NewFlowCtrlInitSize(initSize uint32) (*FlowCtrlWin, error)

NewFlowCtrlInitSize creates a new flow control window for sending. This method returns framing.ErrInvalidDeltaWindowSize if the delta size is invalid

func NewFlowCtrlWin

func NewFlowCtrlWin() *FlowCtrlWin

NewFlowCtrlWin calls NewCtrlFlowWinInitSize(DEFAULT_WINDOW_SIZE)

func (*FlowCtrlWin) InitSize

func (w *FlowCtrlWin) InitSize(initSize uint32) error

InitSize chances the window size. Should be called when receiving a SETTINGS frame with ID SETTINGS_INITIAL_WINDOW_SIZE. This method returns framing.ErrInvalidDeltaWindowSize if the delta size is invalid.

func (*FlowCtrlWin) Return

func (w *FlowCtrlWin) Return(delta uint32) error

Return returns some amount of window. L must be locked before call this method. When a WINDOW_UPDATE frame is received, lock L first, then call this method with the delta widnow size, and unlock L when done. This method returns framing.ErrInvalidDeltaWindowSize if the delta size is invalid, and returns ErrWindowDeltaOverflow if plusing this delta causes window over flow.

func (*FlowCtrlWin) Use

func (w *FlowCtrlWin) Use(delta uint32)

Use takes up some amount of window. L must be locked before call this method. When sending data, lock L first, then call this method and send that amount of data, and unlock L when done.

type PriorityItem

type PriorityItem interface {
	// Whether this item take precedence over the other item.
	TakePrecedenceOver(other PriorityItem) bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL