|
[
Permlink
| « Hide
]
Trustin Lee added a comment - 01/Jul/05 01:05 PM
Should a 'setReuseAddress() call be invoked to ServerSocketChannel or SocketChannel? If it should be called to SocketChannel, doesn't calling Session.getConfig().setReuseAddress(true) in sessionCreated() work?
On the ServerSocketChannel. Taking an example where a server goes down for some reason, and an automated script tries to bring it back up again, the server needs to be able to bind to the same "well-known" port. If it is in TIME_WAIT state, as it most probably will be, the server will not be able to bind to the port unless setReuseAddress is set to true.
The client side implementation is fine. Then what do you think about setting ReuseAddress to true by default and not providing any configurations?
I'm OK with that w.r.t my current need, but it could cause certain problems due to negligence. eg - two instances of the server might be started by mistake and both would be getting data from the network. And keeping this as default might break someone's current implementation that depends on this being false. I'd suggest not changing default behavior - i.e. the standard JDK approach.
This issue has been resolved in 0.9 stream because the solution is not that simple to apply
Please close this issue if it is considered fixed.
Meets the requirements. Thanks.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||