From: Casey Marshall <csm@gnu.org>
To: Jeroen Frijters <jeroen@sumatra.nl>
Cc: mauve-discuss@sourceware.org
Subject: Re: New SocketChannel test that requires testing
Date: Tue, 19 Sep 2006 18:36:00 -0000 [thread overview]
Message-ID: <45103899.7070400@gnu.org> (raw)
In-Reply-To: <D92197D0A6547B44A1567814F851FA6827A99E@LEMBU.sumatrasoftware.com>
Jeroen Frijters wrote:
> Casey Marshall wrote:
>> Jeroen Frijters wrote:
>>> Casey Marshall wrote:
>>>> Maybe we are wrong for returning true for `isConnected' that
>>>> early after trying to establish the connection; the test
>> we're using
>>>> is whether or not the socket has a remote address or not, which may
>>>> not be the criteria we're interested in.
>>> Yes, I believe that's incorrect. I think you can only
>> transition into
>>> the connected state by calling finishConnect (if connect
>> was called in
>>> non-blocking mode).
>>>
>> That's not necessarily true; on some systems, even a non-blocking call
>> to connect() can succeed immediately, if you are connecting
>> to the local machine. It doesn't sound right that you get this
>> condition even when the server process hasn't pulled the connection
>> off the queue, but that may be how it works.
>
> I don't think it has nothing to do with the underlying socket mechanics,
> it is simply an invariant of the SocketChannel API.
>
Nope:
"If this channel is in non-blocking mode then an invocation of this
method initiates a non-blocking connection operation. If the connection
is established immediately, as can happen with a local connection, then
this method returns true. Otherwise this method returns false and the
connection operation must later be completed by invoking the
finishConnect method." [1]
1.
http://java.sun.com/j2se/1.4.2/docs/api/java/nio/channels/SocketChannel.html#connect(java.net.SocketAddress)
next prev parent reply other threads:[~2006-09-19 18:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-18 11:30 Jeroen Frijters
2006-09-18 22:45 ` Casey Marshall
2006-09-19 5:32 ` Jeroen Frijters
2006-09-19 8:08 ` Casey Marshall
2006-09-19 8:21 ` Jeroen Frijters
2006-09-19 18:36 ` Casey Marshall [this message]
2006-09-20 4:34 ` Jeroen Frijters
2006-09-20 5:14 ` Casey Marshall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45103899.7070400@gnu.org \
--to=csm@gnu.org \
--cc=jeroen@sumatra.nl \
--cc=mauve-discuss@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).