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



Tom Tromey <tromey@redhat.com> writes:
> 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.

Yes.

The only big difference is Win32 sockets aren't "really" file
descriptors, they just look like them. Fortunately none of libgcj
assumes that file file descriptors and socket file descriptors are
interchangeable.


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

Nah, the socket subsystem is similar enough. Microsoft's docs even say
that it should be semantically compatable with BSD sockets, modulo the
naming scheme.


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

Win32 returns a special error code if you try to write to a file
descriptor which would block, and you nave nonblocking IO turned on
for that descriptor.

That's how POSIX does it too, right? If so, it's just a matter of
#defining the error code.


  - a


-- 
"If I put copyrighted material into the 'chewy nougat center', I can
 claim the crunchy chocolate coating is an 'Access Control
 Mechanism'."                                     --lynx_user_abroad

Why Windows NT/2k/XP is unreliable: www.zappadoodle.com


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