This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: socket and timeouts
- To: bryce at waitaki dot otago dot ac dot nz
- Subject: Re: socket and timeouts
- From: "Nic Ferrier" <nferrier at tapsellferrier dot co dot uk>
- Date: Sat, 30 Jun 2001 04:11:01 +0100
- Cc: java at gcc dot gnu dot org
>>> Bryce McKinlay <bryce@waitaki.otago.ac.nz> 28-Jun-01 5:05:50 AM
>>>
I think it is a good plan. There are also some
other reasons why we should have separate
Socket IO from FileDescriptor, like implementing
shutdownInput/shutdownOutput, and implementing
things correctly on native win32 where a socket is
not the same as a file descriptor.
You'll see my post to java@gcc.gnu.org about having done the impl.
What I've done is to add timeout support as per my original mail, I
haven't:
- added Windows timeout handling
- added intelligent shutdown handling
For the latter, I did program winsock about a million years ago (3.11
stuff) so I don't think I'm best qualified to add the code for that
(but I'll do it if no one else wants to).
But as far as intelligent shutdown handling goes I'm not entirely
sure what should be done. Should I be doing something to support
SO_LINGER? Presumably that's handled by glibc?
What I've done is:
- code the streams' close methods call the socket's close method.
- write a CNI close method which does a shutdown on the socket
The shutdown() is specified as:
- don't write any more data
- don't read any more data
Perhaps it should be different depending on the value of close()?
BTW: Classpath's impl just does a close() on the file descriptor.
Nic