Bind a single time to the same port in Mac OS XI think I've resolved a problem I came across earlier: I could bind to the same port multiple times using NIO on Mac OS X.
A kind soul named Timothy Wall has helped me to work-around the problem. Just call setSoReuseAddress(false) on the channel's socket before binding:
ServerSocketChannel channel = ServerSocketChannel.open();
ServerSocket socket = channel.socket();
See the related thread on the Mac Java mailing list: