vapor-community / sockets

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

Add Timeout functionality to Socket #30

Closed MatthiasKreileder closed 8 years ago

MatthiasKreileder commented 8 years ago

When the client waited a reasonable amount of time to get a response from the server the client should be notified by a time-out signal and have the option to act on that event (e.g. retransmission or throwing an error). The amount of time before a time-out happens should be configurable because it will vary depending on what the server side does and be set to a reasonable default value, e.g. 2 seconds.

czechboy0 commented 8 years ago

Actually I think we should add this to all sockets, both UDP and TCP. Even with TCP, you might send a request, the server crashes and you're left hanging. We should time out here as well after a predefined time.