-
Bug
-
Resolution: Fixed
-
P3
-
8u102
-
b14
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8239144 | 11.0.7 | Daniil Titov | P3 | Resolved | Fixed | b04 |
SocketListeningConnector.startListening does not allow several invocations with port 0
according to
http://docs.oracle.com/javase/8/docs/technotes/guides/jpda/conninv.html
Socket Listening Connector does not require a port to be specified (and it finds available port itself in this case).
Unfortunately it does not work if called consequently if previous connection was not yet accepted.
See attached test case.
There is a check inside GenericListeningConnector preventing listening with the same params as before but it
seems that it should be aware of auto detecting ports (0).
I expect SocketListeningConnector.startListening to work as many times as I need with unspecified (auto) port.
In the test case provided I get an exception:
Exception in thread "main"
com.sun.jdi.connect.IllegalConnectorArgumentsException: Already listening
at com.sun.tools.jdi.GenericListeningConnector.startListening(GenericListeningConnector.java:110)
at com.sun.tools.jdi.SocketListeningConnector.startListening(SocketListeningConne ctor.java:85)
at Listen2.main(Listen2.java:15)
- backported by
-
JDK-8239144 SocketListeningConnector does not allow invocations with port 0
-
- Resolved
-