server.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
server.go
@@ -5,6 +5,7 @@ "fmt" "net" "strconv" "strings" "time" "github.com/long/test/esutil" @@ -43,7 +44,9 @@ for { conn, err := listener.Accept()// ipStr := conn.RemoteAddr().String() clientIpPort := conn.RemoteAddr().String() index := strings.Index(clientIpPort, ":") ipStr := clientIpPort[:index-1] if oldConn,ok := ipMap[ipStr];ok { oldConn.Close() }