Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMsgNotProto = errors.New("msg not proto") ErrProtocol = errors.New("protocol too much") ErrNotRegister = errors.New("protocol not register") ErrMsgShort = errors.New("msg too short") )
View Source
var (
ErrExceedMaxConn = errors.New("maximum connections exceeded")
)
Functions ¶
func NewMsgProtocol ¶
func NewMsgProtocol(useBigEndian bool)
Types ¶
type MsgProtocol ¶
type MsgProtocol struct {
// contains filtered or unexported fields
}
协议 id + proto.Message
func GetMsgProtocol ¶
func GetMsgProtocol() *MsgProtocol
func (*MsgProtocol) Marshal ¶
func (m *MsgProtocol) Marshal(msg interface{}) ([]byte, error)
func (*MsgProtocol) Unmarshal ¶
func (m *MsgProtocol) Unmarshal(msg []byte) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.