Name: bsC130419 Date: 06/12/2001
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
To use the new I/O infrastructure with UDP sockets, and its speed improvements,
(using Channel) you need to open the socket with DatagramChannel.open().
There are many problems with the current implementation:
- there is no open() method that takes an InetAddress as a parameter,
like the DatagramSocket() constructors.
- the DatagramChannel.open() command already bind the socket to an
ephemeral port, and since there is no "unbind" method, calling
"channel.getSocket.bind()"
generates an "AlreadyBound" exception.
- because DatagramChannel.open() call bind() internally, you cannot
set options that need to be setup *before* calling bind, like SO_REUSEADDR
My specific problem is that I have a 4-NIC server, and I want to create two
sockets, each bound to a single IP address/NIC, on the *same* port number, with
the new I/O. How do I do that?
I suggest providing a way to open a DatagramChannel not bounb to
any port.
(Review ID: 125882)
======================================================================