From 2d49b5855a642aad28210e475c83065955c52c23 Mon Sep 17 00:00:00 2001 From: qydysky Date: Sat, 1 Aug 2020 18:34:44 +0800 Subject: [PATCH] 22 --- Port.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 { -- 2.39.2