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.
Caused by: java.net.SocketException: A system call received a parameter that is not valid.
at sun.nio.ch.Net.localInetAddress(Native Method)
... 5 more
Any help would be most welcome.