Last Comment Bug 102267 - No way to set SO_REUSEADDR on SSLServerSocket
: No way to set SO_REUSEADDR on SSLServerSocket
Product: JSS
Classification: Components
Component: Library (show other bugs)
: 3.1
: All All
-- normal (vote)
: 3.1.1
Assigned To: Jamie Nicolson
: somni
Depends on:
  Show dependency treegraph
Reported: 2001-09-28 15:15 PDT by Jamie Nicolson
Modified: 2001-09-28 15:28 PDT (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---


Description User image Jamie Nicolson 2001-09-28 15:15:03 PDT
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.
Comment 1 User image Jamie Nicolson 2001-09-28 15:28:12 PDT
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:; previous revision:

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

/cvsroot/mozilla/security/jss/org/mozilla/jss/ssl/,v  <--
new revision:; 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  <-- 
new revision: 1.7; previous revision: 1.6

/cvsroot/mozilla/security/jss/org/mozilla/jss/ssl/,v  <--
new revision: 1.6; previous revision: 1.5

Note You need to log in before you can comment on or make changes to this bug.