add server quit command to quit without clients

cc #177
This commit is contained in:
Gokcehan committed 2021-05-19 21:47:53 +03:00
1 parent 1841bba3e6
commit 7bf895e301
1 file changed
+6
+6
View File
@@ -99,6 +99,12 @@ Loop:
}
}
}
case "quit":
if len(gConnList) == 0 {
gQuitChan <- struct{}{}
gListener.Close()
break Loop
}
case "quit!":
gQuitChan <- struct{}{}
for _, c := range gConnList {