aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.go b/main.go
index 56e9e56..ce48801 100644
--- a/main.go
+++ b/main.go
@@ -44,7 +44,7 @@ func main() {
var mu sync.Mutex
go func() {
- sig := make(chan os.Signal)
+ sig := make(chan os.Signal, 1)
signal.Notify(sig, os.Interrupt, syscall.SIGTERM, syscall.SIGHUP)
<-sig
l.close()
@@ -56,7 +56,7 @@ func main() {
wg.Add(len(clts))
for cc := range clts {
- go func() {
+ go func(cc *clientConn) {
ack, _ := cc.SendCmd(&mt.ToCltDisco{Reason: mt.Shutdown})
select {
case <-cc.Closed():
@@ -67,7 +67,7 @@ func main() {
<-cc.server().Closed()
cc.srv = nil
wg.Done()
- }()
+ }(cc)
}
wg.Wait()