修改网络底层

This commit is contained in:
duanhf2012
2020-03-13 15:37:49 +08:00
parent 686d88cabc
commit 0d98f77d07
2 changed files with 2 additions and 6 deletions

View File

@@ -19,7 +19,6 @@ type ITcpSocketServerReciver interface {
OnConnected(pClient *SClient)
OnDisconnect(pClient *SClient)
OnRecvMsg(pClient *SClient, pPack *MsgBasePack)
VerifyPackType(packtype uint16) bool
}
@@ -175,7 +174,7 @@ func (slf *SClient) listendata(){
fillsize,bfillRet,fillhead := pack.FillData(buff,buffDataSize)
//提交校验头
if fillhead == true {
if pack.PackSize>slf.tcpserver.MaxRecvPackSize || slf.tcpserver.iReciver.VerifyPackType(pack.PackType) == false {
if pack.PackSize>slf.tcpserver.MaxRecvPackSize {
service.GetLogger().Printf(service.LEVER_WARN, "VerifyPackType error clent id %d is disconnect %d,%d",slf.id,pack.PackType, pack.PackSize)
return
}