Re: TCP connect in Non Blocking Mode
- From: Rainer Temme <Rainer_Temme@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 25 Apr 2008 22:59:35 +0200
David Schwartz wrote:
On Apr 23, 9:44 am, Rainer Temme <Rainer_Te...@xxxxxxxxxxxxxxxxxxxxxx>
wrote:
Prabhu wrote:err = connect(sd, (struct sockaddr*) &sa, sizeof(sa));....l_fds=select(sd+1, NULL,&filedes_set,NULL,&l_connect_timeout);Have you tried to select() the filedescriptor for read (in the
This works fine. The issue that I face is when the server refuses
connection by sending RST for the SYN from client. The select waits
for 30 seconds and later returns timing out. RST though is sent
immediately by the server. The client application need to capture the
RST as soon as it arrives. How do we achieve that. Why does not the
select return immediately when the RST arrives at client?
read-fd-set) as well?
He's trying to connect. Checking for readability doesn't make sense
unless he has nothing else to do until the other side sends him any
data.
Acutally, select() poll() do NOT check for readablity but for
the ability to call read() without being blocked in the call.
Since the connection is refused by the RST, read() should
return iommediately with result -1 and errno set to ECONNREFUSED.
And select() should indicate that a read() can be called without
being blocked.
Rainer
.
- Follow-Ups:
- Re: TCP connect in Non Blocking Mode
- From: David Schwartz
- Re: TCP connect in Non Blocking Mode
- References:
- TCP connect in Non Blocking Mode
- From: Prabhu
- Re: TCP connect in Non Blocking Mode
- From: Rainer Temme
- Re: TCP connect in Non Blocking Mode
- From: David Schwartz
- TCP connect in Non Blocking Mode
- Prev by Date: Re: Bit bucket directory
- Next by Date: Re: TCP connect in Non Blocking Mode
- Previous by thread: Re: TCP connect in Non Blocking Mode
- Next by thread: Re: TCP connect in Non Blocking Mode
- Index(es):
Relevant Pages
|