Re: socket question
- From: Stuart <bigdakine@xxxxxxx>
- Date: Fri, 30 May 2008 19:00:26 -0700 (PDT)
On May 30, 11:03 am, Alexandre Ferrieux <alexandre.ferri...@xxxxxxxxx>
wrote:
On May 30, 10:36 am, Stuart <bigdak...@xxxxxxx> wrote:
Perhaps somebody can help me understand this behavior..
On host1 inside the tcl shell I type
set s [socket -async host1 19000]
I get an error "couldn't open socket: connection refused". This I
expected
as I have no server listening on host1:19000
On host2 inside the tcl shell I type
set s [socket -async host1 19000]
and I get "sock5". There is still no server listening on host1:19000,
and so I'm
wondering why on host2 I don't get the "couldn't open socket:
connection refused" message?
The reason is that the [socket -async] may fail synchronously on the
local interface (pointing to the same machine), probably due to the OS
optimizing the TCP handshake on the loopback. While when you're
attempting the connection from host2, no such optimization takes
place, and the connect() syscall returns success before getting the
(failed) result from the handshake a finite amount of time later.
-Alex
Thanks. That does make sense. When I removed the -async both the
attempts from
host1 and host2 failed in the same way with the connection refused
message.
Stuart
.
- References:
- socket question
- From: Stuart
- Re: socket question
- From: Alexandre Ferrieux
- socket question
- Prev by Date: What can God never see?
- Next by Date: Re: blt graph element element - add points to a line
- Previous by thread: Re: socket question
- Next by thread: invoking
- Index(es):
Relevant Pages
|