re PR libgcj/11521 ([win32] can install server socket on same port twice)
PR libgcj/11521: * gnu/java/net/natPlainSocketImplWin32.cc (bind): Don't use SO_REUSEADDR From-SVN: r73116
This commit is contained in:
parent
b82183ab3f
commit
76506a3ee3
2 changed files with 6 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2003-10-30 Mohan Embar <gnustuff@thisiscool.com>
|
||||||
|
|
||||||
|
PR libgcj/11521:
|
||||||
|
* gnu/java/net/natPlainSocketImplWin32.cc
|
||||||
|
(bind): Don't use SO_REUSEADDR
|
||||||
|
|
||||||
2003-10-30 Mohan Embar <gnustuff@thisiscool.com>
|
2003-10-30 Mohan Embar <gnustuff@thisiscool.com>
|
||||||
|
|
||||||
PR libgcj/6652:
|
PR libgcj/6652:
|
||||||
|
|
|
@ -67,7 +67,6 @@ gnu::java::net::PlainSocketImpl::bind (::java::net::InetAddress *host, jint lpor
|
||||||
jbyteArray haddress = host->addr;
|
jbyteArray haddress = host->addr;
|
||||||
jbyte *bytes = elements (haddress);
|
jbyte *bytes = elements (haddress);
|
||||||
int len = haddress->length;
|
int len = haddress->length;
|
||||||
int i = 1;
|
|
||||||
|
|
||||||
if (len == 4)
|
if (len == 4)
|
||||||
{
|
{
|
||||||
|
@ -93,9 +92,6 @@ gnu::java::net::PlainSocketImpl::bind (::java::net::InetAddress *host, jint lpor
|
||||||
else
|
else
|
||||||
throw new ::java::net::SocketException (JvNewStringUTF ("invalid length"));
|
throw new ::java::net::SocketException (JvNewStringUTF ("invalid length"));
|
||||||
|
|
||||||
// Enable SO_REUSEADDR, so that servers can reuse ports left in TIME_WAIT.
|
|
||||||
::setsockopt(native_fd, SOL_SOCKET, SO_REUSEADDR, (char *) &i, sizeof(i));
|
|
||||||
|
|
||||||
if (::bind (native_fd, ptr, len) != SOCKET_ERROR)
|
if (::bind (native_fd, ptr, len) != SOCKET_ERROR)
|
||||||
{
|
{
|
||||||
address = host;
|
address = host;
|
||||||
|
|
Loading…
Add table
Reference in a new issue