• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 152
VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic