Issue Details (XML | Word | Printable)

Key: DIRMINA-64
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Trustin Lee
Reporter: Vinod Panicker
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
MINA

SocketAcceptor needs to expose setReuseAddress()

Created: 18/Jun/05 07:11 PM   Updated: 05/Jul/05 02:57 PM
Return to search
Component/s: None
Affects Version/s: 0.7.0, 0.7.1, 0.7.2
Fix Version/s: 0.9.0

Time Tracking:
Not Specified

Environment: All

Resolution Date: 05/Jul/05 02:48 PM


 Description  « Hide
The SocketAcceptor currently doesn't expose setReuseAddress() functionality. This is extremely necessary for server implementations. It would be great if a SocketAcceptor could expose a SocketSessionConfig type of class.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
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?

Vinod Panicker added a comment - 01/Jul/05 03:47 PM
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.

Trustin Lee added a comment - 01/Jul/05 03:50 PM
Then what do you think about setting ReuseAddress to true by default and not providing any configurations?

Vinod Panicker added a comment - 01/Jul/05 04:13 PM
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.

Trustin Lee added a comment - 05/Jul/05 02:47 PM
This issue has been resolved in 0.9 stream because the solution is not that simple to apply

Trustin Lee added a comment - 05/Jul/05 02:48 PM
Please close this issue if it is considered fixed.

Vinod Panicker added a comment - 05/Jul/05 02:57 PM
Meets the requirements. Thanks.