Versions in this module Expand all Collapse all v0 v0.1.0 Oct 25, 2017 Changes in this version + var NETWORK_ENDIAN = binary.LittleEndian + func ConnectTCP(host string, port int) (net.Conn, error) + func IsConnectionError(_err interface{}) bool + func PackFloat32(order binary.ByteOrder, b []byte, f float32) + func PutFloat32(b []byte, f float32) + func ServeTCP(listenAddr string, delegate TCPServerDelegate) error + func ServeTCPForever(listenAddr string, delegate TCPServerDelegate) + func UnpackFloat32(order binary.ByteOrder, b []byte) (f float32) + type BufferedConnection struct + func NewBufferedConnection(conn Connection) *BufferedConnection + func (brc *BufferedConnection) Flush() error + func (brc *BufferedConnection) Read(p []byte) (int, error) + func (brc *BufferedConnection) Write(p []byte) (int, error) + type Connection interface + Flush func() error + type GobMsgPacker struct + func (mp GobMsgPacker) PackMsg(msg interface{}, buf []byte) ([]byte, error) + func (mp GobMsgPacker) UnpackMsg(data []byte, msg interface{}) error + type JSONMsgPacker struct + func (mp JSONMsgPacker) PackMsg(msg interface{}, buf []byte) ([]byte, error) + func (mp JSONMsgPacker) UnpackMsg(data []byte, msg interface{}) error + type JsoniterMsgPacker struct + func (mp JsoniterMsgPacker) PackMsg(msg interface{}, buf []byte) ([]byte, error) + func (mp JsoniterMsgPacker) UnpackMsg(data []byte, msg interface{}) error + type MessagePackMsgPacker struct + func (mp MessagePackMsgPacker) PackMsg(msg interface{}, buf []byte) ([]byte, error) + func (mp MessagePackMsgPacker) UnpackMsg(data []byte, msg interface{}) error + type MsgPacker interface + PackMsg func(msg interface{}, buf []byte) ([]byte, error) + UnpackMsg func(data []byte, msg interface{}) error + var MSG_PACKER MsgPacker = MessagePackMsgPacker{} + type NetConnection struct + func (c NetConnection) Flush() error + type Packet struct + func NewPacket() *Packet + func (p *Packet) AddRefCount(add int64) + func (p *Packet) AppendArgs(args []interface{}) + func (p *Packet) AppendBool(b bool) + func (p *Packet) AppendByte(b byte) + func (p *Packet) AppendBytes(v []byte) + func (p *Packet) AppendClientID(id common.ClientID) + func (p *Packet) AppendData(msg interface{}) + func (p *Packet) AppendEntityID(id common.EntityID) + func (p *Packet) AppendFloat32(f float32) + func (p *Packet) AppendFloat64(f float64) + func (p *Packet) AppendStringList(list []string) + func (p *Packet) AppendUint16(v uint16) + func (p *Packet) AppendUint32(v uint32) + func (p *Packet) AppendUint64(v uint64) + func (p *Packet) AppendVarBytes(v []byte) + func (p *Packet) AppendVarStr(s string) + func (p *Packet) AssureCapacity(need uint32) + func (p *Packet) ClearPayload() + func (p *Packet) GetPayloadLen() uint32 + func (p *Packet) HasUnreadPayload() bool + func (p *Packet) Payload() []byte + func (p *Packet) PayloadCap() uint32 + func (p *Packet) PopUint32() (v uint32) + func (p *Packet) ReadArgs() [][]byte + func (p *Packet) ReadBool() (v bool) + func (p *Packet) ReadBytes(size uint32) []byte + func (p *Packet) ReadClientID() common.ClientID + func (p *Packet) ReadData(msg interface{}) + func (p *Packet) ReadEntityID() common.EntityID + func (p *Packet) ReadFloat32() float32 + func (p *Packet) ReadFloat64() float64 + func (p *Packet) ReadOneByte() (v byte) + func (p *Packet) ReadStringList() []string + func (p *Packet) ReadUint16() (v uint16) + func (p *Packet) ReadUint32() (v uint32) + func (p *Packet) ReadUint64() (v uint64) + func (p *Packet) ReadVarBytes() []byte + func (p *Packet) ReadVarStr() string + func (p *Packet) Release() + func (p *Packet) SetNotCompress() + func (p *Packet) SetPayloadLen(plen uint32) + func (p *Packet) TotalPayload() []byte + func (p *Packet) UnreadPayload() []byte + func (p *Packet) UnwrittenPayload() []byte + type PacketConnection struct + func NewPacketConnection(conn Connection, compressor compress.Compressor) *PacketConnection + func (pc *PacketConnection) Close() error + func (pc *PacketConnection) Flush(reason string) (err error) + func (pc *PacketConnection) LocalAddr() net.Addr + func (pc *PacketConnection) NewPacket() *Packet + func (pc *PacketConnection) RecvPacket() (*Packet, error) + func (pc *PacketConnection) RemoteAddr() net.Addr + func (pc *PacketConnection) SendPacket(packet *Packet) error + func (pc *PacketConnection) SetRecvDeadline(deadline time.Time) error + func (pc *PacketConnection) String() string + type TCPServerDelegate interface + ServeTCPConnection func(net.Conn)