123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package yamux
- const (
- // protoVersion is the only version we support
- protoVersion = 0
- )
- const (
- // Data is used for data frames. They are followed
- // by length bytes worth of payload.
- typeData uint8 = iota
- // WindowUpdate is used to change the window of
- // a given stream. The length indicates the delta
- // update to the window.
- typeWindowUpdate
- // Ping is sent as a keep-alive or to measure
- // the RTT. The StreamID and Length value are echoed
- // back in the response.
- typePing
- // GoAway is sent to terminate a session. The StreamID
- // should be 0 and the length is an error code.
- typeGoAway
- )
- const (
- // SYN is sent to signal a new stream. May
- // be sent with a data payload
- flagSYN uint8 = 1 << iota
- // ACK is sent to acknowledge a new stream. May
- // be sent with a data payload
- flagACK
- // FIN is sent to half-close the given stream.
- // May be sent with a data payload.
- flagFIN
- // RST is used to hard close a given stream.
- flagRST
- // LZW is used to indicate that the payload is
- // compressed with the LZW algorithm
- flagLZW
- )
- const (
- // initialSessionWindow is the initial session window size
- initialSessionWindow = 2 * 1024 * 1024
- // initialStreamWindow is the initial stream window size
- initialStreamWindow = 256 * 1024
- )
- const (
- // goAwayNormal is sent on a normal termination
- goAwayNormal uint32 = iota
- // goAwayProtoErr sent on a protocol error
- goAwayProtoErr
- // goAwayInternalErr sent on an internal error
- goAwayInternalErr
- )
|