For java.net.Socket class
constructor
Socket(InetAddress address, int port,
InetAddress clientAddress, int clientPort)
allows passing (InetAddress)null as clientAddress. ( in JDK 5, JDK 6, JDK 7 )
It looks like in this case the system will pick up a valid local address for create/bind.
Specification for this constructor doesn't reflect this.
The same promlem is in spec for javax.net.ssl.SSLSocket class for similar constructor.
For instance spec in Socket class for method
void bind(SocketAddress bindpoint)
clearly says that:
"If the address is null, then the system will pick up an ephemeral port and a valid local address to bind the socket."
It will be good idea to have the similar info in spec concerning constructor
Socket(InetAddress address, int port, InetAddress clientAddress, int clientPort)
and the same for class SSLSocket:
SSLSocket(InetAddress address, int port, InetAddress localAddr, int localPort)
( See CR 6571950 )
constructor
Socket(InetAddress address, int port,
InetAddress clientAddress, int clientPort)
allows passing (InetAddress)null as clientAddress. ( in JDK 5, JDK 6, JDK 7 )
It looks like in this case the system will pick up a valid local address for create/bind.
Specification for this constructor doesn't reflect this.
The same promlem is in spec for javax.net.ssl.SSLSocket class for similar constructor.
For instance spec in Socket class for method
void bind(SocketAddress bindpoint)
clearly says that:
"If the address is null, then the system will pick up an ephemeral port and a valid local address to bind the socket."
It will be good idea to have the similar info in spec concerning constructor
Socket(InetAddress address, int port, InetAddress clientAddress, int clientPort)
and the same for class SSLSocket:
SSLSocket(InetAddress address, int port, InetAddress localAddr, int localPort)
( See CR 6571950 )
- relates to
-
JDK-6571950 SSLSocket(raddr, rport, laddr, lport) allows null as laddr that spec doesn't reflect
-
- Closed
-