]> 127.0.0.1 Git - part/.git/commitdiff
22
authorqydysky <qydysky@foxmail.com>
Sat, 1 Aug 2020 10:34:44 +0000 (18:34 +0800)
committerqydysky <qydysky@foxmail.com>
Sat, 1 Aug 2020 10:34:44 +0000 (18:34 +0800)
Port.go

diff --git a/Port.go b/Port.go
index 8891d491218552e9b6aa23c24c635127f17f0648..5446b82274e31b2d007277935ad84680afab59fe 100644 (file)
--- a/Port.go
+++ b/Port.go
@@ -24,12 +24,13 @@ func (*port) Del(key string) {
        delete(port_map,key)
 }
 
-func (*port) Set(key string,l net.Listener) {
+func (*port) Set(key string,l net.Listener) int {
        port_buf<-true
        defer func(){
                <-port_buf
        }()
        port_map[key] = l.Addr().(*net.TCPAddr).Port
+       return l.Addr().(*net.TCPAddr).Port
 }
 
 func (*port) New(key string) int {