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.
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.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.