SocketAdapter throws the Socket exception for some reason when try to getLocalport from the SocketAdapter.
Due to this,
thread died instead of catch an exception. it looks like a bug in SocketAdapter.getLocalPost() method. This method should not throw any exception.
It should be return -1 if Socket is not bound instead of any Exception as per
Java API
Doc.
Exception in thread "Read" java.lang.Error: java.net.SocketException: A system call received a parameter that is not valid.
at sun.nio.ch.Net.localAddress(Net.java:171)
at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:442)
at sun.nio.ch.SocketAdaptor.getLocalPort(SocketAdaptor.java:171)
Caused by: java.net.SocketException: A system call received a parameter that is not valid.
at sun.nio.ch.Net.localInetAddress(Native Method)
at sun.nio.ch.Net.localAddress(Net.java:168)
... 5 more
Any help would be most welcome.