This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: WIN-24: natPlainDatagramSocket.cc
- From: Tom Tromey <tromey at redhat dot com>
- To: Adam Megacz <patches at lists dot megacz dot com>
- Cc: java-patches at gcc dot gnu dot org
- Date: 25 Feb 2002 17:03:41 -0700
- Subject: Re: WIN-24: natPlainDatagramSocket.cc
- References: <86pu2u1mct.fsf@megacz.com>
- Reply-to: tromey at redhat dot com
>>>>> "Adam" == Adam Megacz <patches@lists.megacz.com> writes:
Adam> Here's the issue. natPlainDatagramSocket uses select() on a
Adam> single file descriptor to achieve timeouts since socket-level
Adam> timeouts aren't always available on POSIX. Win32 provides
Adam> select() ONLY for sockets
Ok.
Adam> I'd rather not write a _Jv_select() for Win32, because I'm
Adam> afraid that will lead people to try to use it on normal file
Adam> descriptors.
I agree.
Adam> Could we create some sort of _Jv_socket_read_with_timeout in
Adam> {win32|posix}.cc, which would call _Jv_select() on POSIX and
Adam> recv() with a timeout on Win32?
Is this the only big difference between Win32 and POSIX here?
If so then I agree this is a sensible approach.
If, on the other hand, we're going to start adding a bunch of
functions like this, then it might make more sense to simply have
different implementations of natPlainDatagramSocket for Win32 and
POSIX.
There's also the issue of how this will be affected by the new
non-blocking I/O code, but it probably doesn't make much sense for us
to deal with that until someone is actively working on it.
Tom