natPlainDatagramSocketImpl.cc: Updated #includes for Win32...
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. From-SVN: r50017
This commit is contained in:
parent
3e0e6811b6
commit
77da08b08e
2 changed files with 15 additions and 6 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
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.
|
||||||
|
|
||||||
2002-02-24 Adam Megacz <adam@xwt.org>
|
2002-02-24 Adam Megacz <adam@xwt.org>
|
||||||
|
|
||||||
* win32-threads.cc (_Jv_ThreadInitData): _Jv_Malloc instead of new
|
* win32-threads.cc (_Jv_ThreadInitData): _Jv_Malloc instead of new
|
||||||
|
|
|
@ -8,16 +8,15 @@ details. */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#ifdef USE_WINSOCK
|
#include<platform.h>
|
||||||
#include <windows.h>
|
|
||||||
#include <winsock.h>
|
make #ifdef WIN32
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifndef ENOPROTOOPT
|
#ifndef ENOPROTOOPT
|
||||||
#define ENOPROTOOPT 109
|
#define ENOPROTOOPT 109
|
||||||
#endif
|
#endif
|
||||||
#else /* USE_WINSOCK */
|
#else /* WIN32 */
|
||||||
#include "posix.h"
|
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -29,7 +28,7 @@ details. */
|
||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif /* USE_WINSOCK */
|
#endif /* WIN32 */
|
||||||
|
|
||||||
#if HAVE_BSTRING_H
|
#if HAVE_BSTRING_H
|
||||||
// Needed for bzero, implicitly used by FD_ZERO on IRIX 5.2
|
// Needed for bzero, implicitly used by FD_ZERO on IRIX 5.2
|
||||||
|
@ -328,6 +327,8 @@ java::net::PlainDatagramSocketImpl::receive (java::net::DatagramPacket *p)
|
||||||
jbyte *dbytes = elements (p->getData());
|
jbyte *dbytes = elements (p->getData());
|
||||||
ssize_t retlen = 0;
|
ssize_t retlen = 0;
|
||||||
|
|
||||||
|
// FIXME: implement timeout support for Win32
|
||||||
|
#ifndef WIN32
|
||||||
// Do timeouts via select since SO_RCVTIMEO is not always available.
|
// Do timeouts via select since SO_RCVTIMEO is not always available.
|
||||||
if (timeout > 0)
|
if (timeout > 0)
|
||||||
{
|
{
|
||||||
|
@ -343,6 +344,7 @@ java::net::PlainDatagramSocketImpl::receive (java::net::DatagramPacket *p)
|
||||||
else if (retval == 0)
|
else if (retval == 0)
|
||||||
throw new java::io::InterruptedIOException ();
|
throw new java::io::InterruptedIOException ();
|
||||||
}
|
}
|
||||||
|
#endif /* WIN32 */
|
||||||
|
|
||||||
retlen =
|
retlen =
|
||||||
::recvfrom (fnum, (char *) dbytes, p->getLength(), 0, (sockaddr*) &u,
|
::recvfrom (fnum, (char *) dbytes, p->getLength(), 0, (sockaddr*) &u,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue