You can use Socket.setSoTimeout to set how long you are prepared for a read to complete. setSoTimeout has no effect on how long you are willing to wait for a write (how long you are willing to wait for the other end to accept data), just on how long you are willing to wait for the other end to produce data.
You can use Socket.setSoLinger to control how long the Socket lingers, (waits to close when there are still unsent data). When you shutdown, the other end should continue to read any buffered data to let the other end close before closing itself.
In other instances you need to roll your own timeouts with a Timer or raw Threads.
This page is posted |
http://mindprod.com/jgloss/timeout.html | |
Optional Replicator mirror
|
J:\mindprod\jgloss\timeout.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[18.222.182.249] |
| |
Feedback |
You are visitor number | |