blocking connect()

  • Follow


Hi,

In socket programming, how can i make connect() to block till the server
is is ready to accept()

Regards,
Tejas
0
Reply Tejas 3/6/2004 4:54:57 AM

In article <pan.2004.03.06.04.54.56.946768@usc.edu>,
 Tejas Kokje <kokje@usc.edu> wrote:

> Hi,
> 
> In socket programming, how can i make connect() to block till the server
> is is ready to accept()

You can't.  If the server responds with an RST, indicating that no 
process is listening on the port, this is considered an error and 
connect() returns ECONNREFUSED immediately.

You can loop, waiting a few seconds and calling connect() until 
successful.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
0
Reply Barry 3/6/2004 5:41:47 AM


1 Replies
140 Views

(page loaded in 0.18 seconds)

Similiar Articles:













7/22/2012 7:19:14 PM


Reply: