vapor-community / sockets

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

`closed` property on socket #35

Closed tanner0101 closed 8 years ago

tanner0101 commented 8 years ago

To perform HTTP parsing, serialization, and keep-alive on sockets it's important to know whether or not the socket has closed.

Most socket libs include a closed: Bool property on the socket.

This property may or may not need to be updated if the socket is closed by the client or closed in other ways. It might not be enough to set the flag to true when the socket is closed by calling .close()

czechboy0 commented 8 years ago

I'll add this, but can you add more info on when this flag should be turned on? Definitely on .close(), but maybe also when an error is emitted? Any other cases?

tanner0101 commented 8 years ago

I'll research this and see what other socket libs do.

czechboy0 commented 8 years ago

Fixed by #38, but if you find any other case when closed should be set, please comment here, @tannernelson.