Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLangBuf ¶ added in v1.0.2
func GetLangStr ¶ added in v1.0.2
Types ¶
type CClientSocket ¶
type CClientSocket interface {
OnMigrateCommand(LP_MigrateCommand int16, ip string, port int16)
OnConnect()
Flush()
OnAliveReq(LP_AliveReq int16)
XORRecv(buf []byte)
XORSend(buf []byte)
OnRead()
SendPacket(oPacket COutPacket)
OnError(err error)
Close()
GetAddr() string
}
func NewCClientSocket ¶
func NewCClientSocket(conn net.Conn, rcvIV []byte, sndIV []byte, impl CClientSocketImpl) CClientSocket
type CClientSocketImpl ¶
type CClientSocketImpl interface {
DebugInPacketLog(iPacket CInPacket)
DebugOutPacketLog(oPacket COutPacket)
ProcessPacket(cs CClientSocket, iPacket CInPacket)
SocketClose()
}
type CInPacket ¶
type CInPacket interface {
AppendBuffer(pBuff []byte, bEnc bool)
DecryptData(dwKey []byte)
GetType() int16
GetRemain() int
GetLength() int
DecodeBool() bool
Decode1() int8
Decode2() int16
Decode4() int32
Decode8() int64
DecodeFT() time.Time
DecodeStr() string
DecodeLocalStr() string
DecodeLocalName() string
DecodeBuffer(uSize int) []byte
DumpString(nSize int) string
Clear()
}
func NewCInPacket ¶
type COutPacket ¶
type COutPacket interface {
GetType() int16
GetSendBuffer() []byte
GetLength() int
EncodeBool(b bool)
Encode1(n int8)
Encode2(n int16)
Encode4(n int32)
Encode8(n int64)
EncodeFT(t time.Time)
EncodeStr(s string)
EncodeLocalStr(s string)
EncodeLocalName(s string)
EncodeBuffer(buf []byte)
MakeBufferList(uSeqBase uint16, bEnc bool, dwKey []byte) []byte
DumpString(nSize int) string
}
func NewCOutPacket ¶
func NewCOutPacket(nType int16) COutPacket
Source Files
¶
Click to show internal directories.
Click to hide internal directories.