mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
关闭套接字接口
This commit is contained in:
@@ -115,6 +115,16 @@ func (slf *TcpSocketServer) listenServer(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (slf *TcpSocketServer) Close(clientid uint64) error {
|
||||||
|
pClient := slf.mapClient.Get(clientid)
|
||||||
|
if pClient == nil {
|
||||||
|
return fmt.Errorf("clientid %d is not in connect pool.",clientid)
|
||||||
|
}
|
||||||
|
|
||||||
|
pClient.(*SClient).Close()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (slf *TcpSocketServer) SendMsg(clientid uint64,packtype uint16,message proto.Message) error{
|
func (slf *TcpSocketServer) SendMsg(clientid uint64,packtype uint16,message proto.Message) error{
|
||||||
pClient := slf.mapClient.Get(clientid)
|
pClient := slf.mapClient.Get(clientid)
|
||||||
if pClient == nil {
|
if pClient == nil {
|
||||||
|
|||||||
@@ -153,4 +153,10 @@ func GetTcpSocketPbService(serviceName string) *TcpSocketPbService{
|
|||||||
|
|
||||||
func (slf *TcpSocketPbService) SendMsg(clientid uint64,packtype uint16,message proto.Message) error{
|
func (slf *TcpSocketPbService) SendMsg(clientid uint64,packtype uint16,message proto.Message) error{
|
||||||
return slf.tcpsocketserver.SendMsg(clientid,packtype,message)
|
return slf.tcpsocketserver.SendMsg(clientid,packtype,message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (slf *TcpSocketPbService) Close(clientid uint64) error{
|
||||||
|
return slf.tcpsocketserver.Close(clientid)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user