WIN-24: natPlainDatagramSocket.cc
Adam Megacz
patches@lists.megacz.com
Sun Feb 24 20:12:00 GMT 2002
Bryce McKinlay <bryce@waitaki.otago.ac.nz> writes:
> Shouldn't this just #include "platform.h" unconditionally (and remove
> posix.h). That way you wouldnt need to #undef STRICT explicitly etc.
> Other than that, it looks OK.
Agreed. Committed as shown below.
- a
2002-02-24 Adam Megacz <adam@xwt.org>
* java/net/natPlainDatagramSocketImpl.cc: Updated #includes
for Win32, changed #ifdefs to check WIN32 instead of the
(now-obsolete) USE_WINSOCK, and removed support for socket
timeouts on Win32 pending further discussion.
Index: natPlainDatagramSocketImpl.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/natPlainDatagramSocketImpl.cc,v
retrieving revision 1.31
diff -u -r1.31 natPlainDatagramSocketImpl.cc
--- natPlainDatagramSocketImpl.cc 2002/02/18 07:32:34 1.31
+++ natPlainDatagramSocketImpl.cc 2002/02/25 04:08:22
@@ -8,16 +8,15 @@
#include <config.h>
-#ifdef USE_WINSOCK
-#include <windows.h>
-#include <winsock.h>
+#include<platform.h>
+
+make #ifdef WIN32
#include <errno.h>
#include <string.h>
#ifndef ENOPROTOOPT
#define ENOPROTOOPT 109
#endif
-#else /* USE_WINSOCK */
-#include "posix.h"
+#else /* WIN32 */
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
@@ -29,7 +28,7 @@
#endif
#include <errno.h>
#include <string.h>
-#endif /* USE_WINSOCK */
+#endif /* WIN32 */
#if HAVE_BSTRING_H
// Needed for bzero, implicitly used by FD_ZERO on IRIX 5.2
@@ -328,6 +327,8 @@
jbyte *dbytes = elements (p->getData());
ssize_t retlen = 0;
+// FIXME: implement timeout support for Win32
+#ifndef WIN32
// Do timeouts via select since SO_RCVTIMEO is not always available.
if (timeout > 0)
{
@@ -343,6 +344,7 @@
else if (retval == 0)
throw new java::io::InterruptedIOException ();
}
+#endif /* WIN32 */
retlen =
::recvfrom (fnum, (char *) dbytes, p->getLength(), 0, (sockaddr*) &u,
More information about the Java-patches
mailing list