vapor-community / sockets

🔌 Non-blocking TCP socket layer, with event-driven server and client.
MIT License
575 stars 54 forks source link

KeepAliveServer - quit when connection interrupted #111

Closed jiribohm closed 6 years ago

jiribohm commented 7 years ago

There is definitely a problem in this function. func closeClient(client: TCPClient) throws { print("Closing client: (client.socket.address)") connections.removeValue(forKey: client.socket.descriptor) try client.close()

The client.socket descriptor is not recognized properly.

Some Help?

jiribohm commented 7 years ago

When the connection to client is interrupted for a while, the server quit with this error message: Error Socket failed with code 9 ("Bad file descriptor") [selectFailed([5, 4, 3], [], [5, 4, 3])] Program ended with exit code: 0