()
| 114 | } |
| 115 | |
| 116 | func (server *TCPServer) Close() { |
| 117 | server.ln.Close() |
| 118 | server.wgLn.Wait() |
| 119 | |
| 120 | server.mutexConns.Lock() |
| 121 | for conn := range server.conns { |
| 122 | conn.Close() |
| 123 | } |
| 124 | server.conns = nil |
| 125 | server.mutexConns.Unlock() |
| 126 | server.wgConns.Wait() |
| 127 | } |