Forums Register Login

SocketException:A system call received a parameter that is not valid

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
well, java.lang.Error is not an Exception. So, the documentation is right.

Looks like there is something wrong with the SocketChannel you pass on create.

Any code?

There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 6051 times.
Similar Threads
ObjectInputStream.readObject() hangs forever during socket communication
confused on why socket is closed
AXIX JBoss
Socket is not receiving the first request after long Ideal time
java.net.SocketException: No buffer space available
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 20:39:02.