新增获取客户端ip接口

This commit is contained in:
duanhf2012
2020-05-06 10:40:41 +08:00
parent 2afa611ef5
commit 0512b27a67
2 changed files with 14 additions and 0 deletions

View File

@@ -71,6 +71,10 @@ func (tcpConn *TCPConn) Close() {
tcpConn.closeFlag = true
}
func (tcpConn *TCPConn) GetRemoteIp() string {
return tcpConn.conn.RemoteAddr().String()
}
func (tcpConn *TCPConn) doWrite(b []byte) {
if len(tcpConn.writeChan) == cap(tcpConn.writeChan) {
log.Debug("close conn: channel full")