Documentation ¶
Index ¶
Constants ¶
View Source
const ( SeqSize = 4 MsgIDSize = 4 MsgTypeSize = 1 ErrcodeSize = 4 PktSizeSize = 4 )
Variables ¶
View Source
var ( PingPacket = &Packet{ msgType: MsgPing, } PongPacket = &Packet{ msgType: MsgPong, } )
Functions ¶
Types ¶
type MessageType ¶
type MessageType = byte
const ( MsgReq MessageType = 1 + iota // need reply MsgReply MsgPush // no reply MsgErr // error reply MsgPing MsgPong )
type Packet ¶
type Packet struct {
// contains filtered or unexported fields
}
func (*Packet) GetErrcode ¶
func (*Packet) GetMsgType ¶
func (p *Packet) GetMsgType() MessageType
func (*Packet) GetPayload ¶
func (*Packet) SetPayload ¶
Click to show internal directories.
Click to hide internal directories.