Documentation ¶
Index ¶
Constants ¶
View Source
const ( TYPE_NULL = iota TYPE_HANDSHAKE //1 TYPE_HANDSHAKE_ACK //2 TYPE_HEARTBEAT //3 TYPE_DATA //4 TYPE_KICK //5 PKG_HEAD_BYTES = 4 )
Variables ¶
This section is empty.
Functions ¶
func Encode ¶
*
- Package protocol encode. *
- Pomelo package format:
- +------+-------------+------------------+
- | type | body length | body |
- +------+-------------+------------------+ *
- Head: 4bytes
- 0: package type,
- 1 - handshake,
- 2 - handshake ack,
- 3 - heartbeat,
- 4 - data
- 5 - kick
- 1 - 3: big-endian body length
- Body: body length bytes
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.