package main import "git.wanbits.io/joe/nnet" // protocol && callback, Using TCP type LAProtocol struct{} func (self *LAProtocol) ReadPacket(conn nnet.IConn) (nnet.IPacket, error) { return nil, nil } func (self *LAProtocol) Serialize(packet nnet.IPacket) ([]byte, error) { return nil, nil } func (self *LAProtocol) OnClosed(ses nnet.ISession, reason int32) { } func (self *LAProtocol) OnConnected(ses nnet.ISession) (bool, int32) { return true, 0 } func (self *LAProtocol) OnMessage(ses nnet.ISession, pkt nnet.IPacket) bool { return true } // server-side dont handle heartbeat. func (self *LAProtocol) OnHeartbeat(ses nnet.ISession) bool { return true }