Skip to main content

Implement more tcp socket options

1 reply [Last post]
Joined: 2003-06-10

We need to be able to access more socket options as the could be available at the OS level. For example SO_SNDTIMEO could solve some problems with java generic tcp/ip servers.


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-17

If the issue is that you don't want the application to block indefinitely on a write then you can do this with New I/O. You can set the socket channel to non-blocking and register it with the selector for OP_WRITE events. That way you control the timeout and your application won't hang indefinitely just because the peer isn't responding or there is severe network congestion.