]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
natPlainSocketImplWin32.cc (connect): Same as previous patch, but for win32.
authorAnthony Green <green@redhat.com>
Wed, 28 Dec 2005 18:47:18 +0000 (18:47 +0000)
committerAnthony Green <green@gcc.gnu.org>
Wed, 28 Dec 2005 18:47:18 +0000 (18:47 +0000)
2005-12-28  Anthony Green  <green@redhat.com>

* gnu/java/net/natPlainSocketImplWin32.cc (connect): Same
as previous patch, but for win32.

From-SVN: r109119

libjava/ChangeLog
libjava/gnu/java/net/natPlainSocketImplWin32.cc

index 7eea0f844a52cfb5bf43ce94f24ed135a1dc78bd..1606ccf9c425726f5e504a6f1a2be72c1905251b 100644 (file)
@@ -1,3 +1,8 @@
+2005-12-28  Anthony Green  <green@redhat.com>
+
+       * gnu/java/net/natPlainSocketImplWin32.cc (connect): Same 
+       as previous patch, but for win32.
+
 2005-12-28  Anthony Green  <green@redhat.com>
 
        * gnu/java/net/natPlainSocketImplPosix.cc (connect): Record
index 48c7171c7c198049cfbedfb52af25aa3c3aa0a5d..f54edb5463099f68758f0f29a17b4c46f5d3b49a 100644 (file)
@@ -133,6 +133,15 @@ gnu::java::net::PlainSocketImpl::connect (::java::net::SocketAddress *addr,
   ::java::net::InetAddress *host = tmp->getAddress();
   jint rport = tmp->getPort();
 
+  // Set the SocketImpl's address and port fields before we try to
+  // connect.  Note that the fact that these are set doesn't imply
+  // that we're actually connected to anything.  We need to record
+  // this data before we attempt the connect, since non-blocking
+  // SocketChannels will use this and almost certainly throw timeout
+  // exceptions.
+  address = host;
+  port = rport;
+
   union SockAddr u;
   socklen_t addrlen = sizeof(u);
   jbyteArray haddress = host->addr;
@@ -208,9 +217,6 @@ gnu::java::net::PlainSocketImpl::connect (::java::net::SocketAddress *addr,
         throwConnectException();
     }
 
-  address = host;
-  port = rport;
-
   // A bind may not have been done on this socket; if so, set localport now.
   if (localport == 0)
     {