• Post Reply Bookmark Topic Watch Topic
  • New Topic

Set SO_EXCLUSIVEADDRUSE using Java  RSS feed

 
R. Praveen Kumar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In java how to set SO_EXCLUSIVEADDRUSE flag to serversocket?

Am not able to find the API call for this in ServerSocket API.

I can set SO_TIMEOUT using setSoTimeout method. But how to set SO_EXCLUSIVEADDRUSE?
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Quite frankly, if memory serves, I don't think you can. I believe that option is windows only, and it really violates the TCP specification in a major way.

If I recall correctly, the latest version of the JVM automatically turns on the option for windows. And there is an environment variable (I think) that will disable it. Unless something changed recently, I don't think that there is an API to set this option.

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