vapor-community / sockets

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

Added select() to observe activity on multiple sockets, more tests #45

Closed czechboy0 closed 8 years ago

czechboy0 commented 8 years ago

This PR adds select(), useful for observing activity on multiple sockets, probably crucial if you want to implement proper keepAlive on your server (instead of closing each client connection after serving one request, just keep it around and watch for more incoming data on the socket, close when the headers tell you to or when no activity has been observed from the socket for a long time)

Might be more efficient solution for Vapor, @tannernelson (instead of blocking one thread per connection)