Closed Bug 102267 Opened 23 years ago Closed 23 years ago

No way to set SO_REUSEADDR on SSLServerSocket

Categories

(JSS Graveyard :: Library, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jamie-bugzilla, Assigned: jamie-bugzilla)

Details

SSLServerSockets always have SO_REUSEADDR set to false. Servers are unable to
re-bind to a port if old sockets are waiting around on it.
Fixed on JSS_3_1_BRANCH and trunk.

I added the methods setReuseAddress and getReuseAddress to SSLServerSocket.
These are protected because they are useless if called from the outside. The
bind() call happens in the constructor, so by the time you could call these
methods it would be too late.

To take advantage of these functions, I added a new constructor that takes a
"boolean reuseAddr" parameter. For backward compatibility, I set the default to
"false". This is also the default for standard Berkeley sockets and NSPR
sockets. On the other hand, Java sockets have this option starting in JDK 1.4,
and their default is "true".
jss.def had to be updated to add the two new native methods to the DLL export list.

/cvsroot/mozilla/security/jss/lib/jss.def,v  <--  jss.def
new revision: 1.6.2.2; previous revision: 1.6.2.1

/cvsroot/mozilla/security/jss/org/mozilla/jss/ssl/SSLServerSocket.c,v  <-- 
SSLServerSocket.c
new revision: 1.4.4.2; previous revision: 1.4.4.1

/cvsroot/mozilla/security/jss/org/mozilla/jss/ssl/SSLServerSocket.java,v  <-- 
SSLServerSocket.java
new revision: 1.5.4.1; previous revision: 1.5

/cvsroot/mozilla/security/jss/lib/jss.def,v  <--  jss.def
new revision: 1.9; previous revision: 1.8

cvs/cvsroot/mozilla/security/jss/org/mozilla/jss/ssl/SSLServerSocket.c,v  <-- 
SSLServerSocket.c
new revision: 1.7; previous revision: 1.6

/cvsroot/mozilla/security/jss/org/mozilla/jss/ssl/SSLServerSocket.java,v  <-- 
SSLServerSocket.java
new revision: 1.6; previous revision: 1.5
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.1.1
You need to log in before you can comment on or make changes to this bug.