升级Go版本为v1.18

This commit is contained in:
GoEdgeLab
2022-07-07 09:21:18 +08:00
parent 8af2a4f63d
commit d7d1575c63
9 changed files with 67 additions and 54 deletions

View File

@@ -8,6 +8,7 @@ type BaseClientConn struct {
rawConn net.Conn
isBound bool
userId int64
serverId int64
remoteAddr string
@@ -46,6 +47,16 @@ func (this *BaseClientConn) ServerId() int64 {
return this.serverId
}
// SetUserId 设置所属服务的用户ID
func (this *BaseClientConn) SetUserId(userId int64) {
this.userId = userId
}
// UserId 获取当前连接所属服务的用户ID
func (this *BaseClientConn) UserId() int64 {
return this.userId
}
// RawIP 原本IP
func (this *BaseClientConn) RawIP() string {
ip, _, _ := net.SplitHostPort(this.rawConn.RemoteAddr().String())