From: qydysky Date: Sat, 1 Aug 2020 10:34:44 +0000 (+0800) Subject: 22 X-Git-Tag: v0.0.2~66 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=2d49b5855a642aad28210e475c83065955c52c23;p=part%2F.git 22 --- diff --git a/Port.go b/Port.go index 8891d49..5446b82 100644 --- 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 {