Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MessageType message type enum MessageType = iota // MTRequest request =1 MTRequest = 1 // MTResponse response = 2 MTResponse = 2 // MTNotify notify = 3 MTNotify = 3 // MTBroadcast broadcast = 4 MTBroadcast = 4 //MTRequestAny request/reply MTRequestAny = 5 //MTResponseAny MTResponseAny = 6 //MTRequestPush pub/sub MTRequestPush = 7 //MTResponsePush MTResponsePush = 8 )
View Source
const ( // InvalidInt32 Invalid values set to -1 InvalidInt32 = -1 // ErrorCodeOK Define error code = 0 if success ErrorCodeOK = 0 )
View Source
const ( // MinSizePower min buffer get from pool, means buf size = 1<<7 MinSizePower = 7 // MaxSizePower max buffer get from pool, means buf size = 1<<16 MaxSizePower = 16 // OutMaxBufferPower means buffer size > MaxBufferSize OutMaxBufferPower = MaxSizePower + 1 // MinBufferSize buffer size 1 << 6 MinBufferSize = 1 << MinSizePower // MaxBufferSize buffer size 1 << 16 MaxBufferSize = 1 << MaxSizePower )
View Source
const MaxIDSequence = 10
MaxIDSequence max srcid sequence
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BytesPool ¶
BytesPool alloc and manger buffer
var GBytesPool *BytesPool
GBytesPool pre-create []byte pool
func (*BytesPool) Alloc ¶
Alloc borrow buffer from pool,if size > MaxBufferSize, dynamic alloc buffer
type Message ¶
type Message struct {
MsgID int32
SrcID int32
DestID int32
SessionID string
MsgType int8
Cmd string
Body proto.Message
ErrCode int32
}
Message mq Message
type MessagePool ¶
MessagePool mamager message objests
var GMessagePool *MessagePool
GMessagePool pre-create message pool
Click to show internal directories.
Click to hide internal directories.