From: tmoran@acm.org
Subject: Re: [OT] Two sockets questions
Date: Sun, 11 May 2003 18:01:49 GMT
Date: 2003-05-11T18:01:49+00:00 [thread overview]
Message-ID: <hewva.290476$Si4.237742@rwcrnsc51.ops.asp.att.net> (raw)
In-Reply-To: 874r428pcb.fsf@inf.enst.fr
> Tom> It's intended for blocking sockets, so it sits around and polls
> Tom> till the select says its writable, or some other error is
> Tom> returned. It actually opens as non-blocking so it can get
> Tom> control back from the OS to do this polling, and timeout
> Tom> checking, etc.
>
> Why not make the socket blocking in this case (around connect()) since
> your code sits and waits for select() to return?
Three reasons: The Open procedure has a timeout parameter, so it needs
to be able to terminate the "connect" early. The package also has a
"Request_Quit" mechanism whereby some task can ask another to abort a wait
on socket activity. It's simpler and clearer to check with a direct poll
loop (with "delay") than with Windows' message loop polling. Also, one of
the targeted compilers does its own tasking within a single Windows
thread, so a true block of the thread would block all tasks. (That
compiler's Ada task switch time, not going through the OS, is quite a bit
faster. It also can target Windows 3.1, though I grant that may no longer
be very important.)
next prev parent reply other threads:[~2003-05-11 18:01 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-07 18:03 [OT] Two sockets questions Jano
2003-05-07 18:22 ` Samuel Tardieu
2003-05-07 19:52 ` Stephen Leake
2003-05-07 20:08 ` David C. Hoos
2003-05-07 22:33 ` Jano
2003-05-08 9:10 ` Samuel Tardieu
2003-05-08 21:35 ` Jano
2003-05-09 8:14 ` Samuel Tardieu
2003-05-09 14:32 ` Jano
2003-05-10 14:06 ` Jano
2003-05-10 18:01 ` tmoran
2003-05-10 21:27 ` Samuel Tardieu
2003-05-11 18:01 ` tmoran [this message]
2003-05-08 17:48 ` Stephen Leake
2003-05-08 18:42 ` Samuel Tardieu
2003-05-08 21:41 ` Jano
2003-05-08 21:48 ` Jano
2003-05-08 22:35 ` tmoran
2003-05-09 14:42 ` Jano
2003-05-10 8:57 ` Tarjei T. Jensen
2003-05-10 16:55 ` Simon Wright
2003-05-11 18:23 ` Tarjei T. Jensen
2003-05-11 2:05 ` tmoran
2003-05-08 21:40 ` Jano
2003-05-07 20:02 ` Jano
2003-05-08 8:57 ` Samuel Tardieu
2003-05-08 21:39 ` Jano
2003-05-08 10:14 ` Preben Randhol
2003-05-08 11:09 ` Samuel Tardieu
2003-05-08 21:40 ` Jano
2003-05-09 8:19 ` Samuel Tardieu
2003-05-08 18:06 ` tmoran
2003-05-07 20:09 ` tmoran
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox