Documentation
¶
Index ¶
Constants ¶
View Source
const ( OpcodeContinuation = 0x0 OpcodeText = 0x1 OpcodeBinary = 0x2 OpcodeClose = 0x8 OpcodePing = 0x9 OpcodePong = 0xA )
WebSocket 常量定义
View Source
const ( CloseNormalClosure uint16 = 1000 CloseGoingAway uint16 = 1001 CloseProtocolError uint16 = 1002 CloseUnsupportedData uint16 = 1003 CloseNoStatusReceived uint16 = 1005 CloseInvalidFramePayloadData uint16 = 1007 ClosePolicyViolation uint16 = 1008 CloseMessageTooBig uint16 = 1009 CloseMandatoryExtension uint16 = 1010 CloseInternalServerErr uint16 = 1011 )
Close 状态码 (RFC 6455 §7.4.1)
Variables ¶
This section is empty.
Functions ¶
func IsValidUtf8 ¶
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
func NewAggregator ¶
func NewAggregator(maxsize uint) *Aggregator
func (*Aggregator) Clear ¶
func (a *Aggregator) Clear()
func (*Aggregator) Received ¶
func (a *Aggregator) Received(data []byte) error
type Client ¶
type Client struct {
OnOpen func()
OnClose func()
OnError func(err error)
OnMessage func(data []byte)
// contains filtered or unexported fields
}
func (*Client) SendBinary ¶
type Connect ¶
type Connect struct {
// contains filtered or unexported fields
}
func NewConnect ¶
func (*Connect) ReadPayload ¶
func (c *Connect) ReadPayload(header *FrameHeader) ([]byte, error)
ReadPayload 读取并解密负载数据
Click to show internal directories.
Click to hide internal directories.