mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
tcpservice服务新增获取连接数接口
This commit is contained in:
@@ -242,3 +242,10 @@ func (tcpService *TcpService) SendRawMsg(clientId uint64,msg []byte) error{
|
|||||||
tcpService.mapClientLocker.Unlock()
|
tcpService.mapClientLocker.Unlock()
|
||||||
return client.tcpConn.WriteMsg(msg)
|
return client.tcpConn.WriteMsg(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (tcpService *TcpService) GetConnNum() int {
|
||||||
|
tcpService.mapClientLocker.Lock()
|
||||||
|
connNum := len(tcpService.mapClient)
|
||||||
|
tcpService.mapClientLocker.Unlock()
|
||||||
|
return connNum
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user