Closed tanner0101 closed 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?
I'll research this and see what other socket libs do.
Fixed by #38, but if you find any other case when closed
should be set, please comment here, @tannernelson.
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()