Documentation
¶
Index ¶
- Constants
- Variables
- func Chunked(content []byte, max int) chan []byte
- func Count(content []byte, max int) int
- func MarshalMessage(sessionId []byte, msg proto.Message) ([]byte, error)
- func ParseHeader(header []byte) ([]byte, int, error)
- func ParseMessage(body []byte) (proto.Message, error)
- func ReadHeader(conn net.Conn) ([]byte, int, error)
- func ReadHeaderWithTimeout(conn net.Conn, timeout time.Duration) ([]byte, int, error)
- func ReadMessage(conn net.Conn, length int) (proto.Message, error)
- func ReadMessageWithTimeout(conn net.Conn, length int, timeout time.Duration) (proto.Message, error)
- func ReadPacket(conn net.Conn) ([]byte, proto.Message, error)
- func ReadPacketWithTimeout(conn net.Conn, timeout time.Duration) ([]byte, proto.Message, error)
- func WritePacket(conn net.Conn, msg proto.Message, sessionId []byte) error
- func WritePacketWithTimeout(conn net.Conn, msg proto.Message, sessionId []byte, timeout time.Duration) error
Constants ¶
View Source
const ( StartDelimiter = 0xd1 EndDelimiter = 0xd2 MsgStart = 0 MsgSessionStart = 1 MsgSessionEnd = 5 HeaderLength = 9 )
Variables ¶
Functions ¶
func ReadHeaderWithTimeout ¶
func ReadMessageWithTimeout ¶
func ReadPacketWithTimeout ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.