This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: WIN-24: natPlainDatagramSocket.cc


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]