Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
albert Jin
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Matt Cartwright
Ranch Hand
Posts: 152
Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!