Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SafeMsgPack ¶
type SafeMsgPack struct {
// contains filtered or unexported fields
}
SafeMsgPack implements the interface IMsgPack, carrying HeadLen and conn for Pack() and Unpack(), and mutex for concurrent Pack() and Unpack().
func NewSafeMsgPack ¶
func NewSafeMsgPack(headleng uint32, conn net.Conn) *SafeMsgPack
NewSafeMsgPack returns a thread-safe packager *SafeMsgPack. NewSafeMsgPack returns the same packager for the same TCP connection, so the value of the headLen is consistent with the first time you new a SafeMsgPack.
func (*SafeMsgPack) GetHeadLen ¶
func (smp *SafeMsgPack) GetHeadLen() uint32
GetHeadLen return headLen of the message.
Click to show internal directories.
Click to hide internal directories.