Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with binding of ServerSocket to any local address on Windows Vista

843790Aug 29 2008 — edited Sep 8 2008
Hello all.

I am using JRE 6 and trying to bind a ServerSocket to "anyLocalAddress" ("0.0.0.0" on IPv4 or "0::0" on IPv6).

Code sample:
serverSocket.bind(new InetSocketAddress(null, 12345));

On all plattforms except Windows Vista it works just fine, but on Windows Vista i receive the following exception, when trying to run the application:

java.net.SocketException: Socket operation on nonsocket: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)


Is there any workaround for this problem?

Thanks in advance,
Michael.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 6 2008
Added on Aug 29 2008
13 comments
842 views