Re: TCP connect in Non Blocking Mode



On Apr 25, 1:59 pm, Rainer Temme <Rainer_Te...@xxxxxxxxxxxxxxxxxxxxxx>
wrote:

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.

But a 'write' can be called without being blocked too, so checking for
readability is at best redundant. If the connection succeeds, it will
be writable but not readable, so checking for 'read'ability won't
detect connection success.

This is why the typical pattern is to check an asynchronous 'connect'
attempt only for writability.

DS
.



Relevant Pages

  • Re: TCP connect in Non Blocking Mode
    ... connection by sending RST for the SYN from client. ... These is no reason to think that checking for readability would have ... any effect on the case where the connection is rejected. ...
    (comp.unix.programmer)
  • Re: printer recommendation for hobbyist cluster
    ... would print plain text as well as PostScript. ... be the ability for a web browser to print a given page (not sure how ... network connection). ... What used DEC/Compaq/HP printers would fit the bill? ...
    (comp.os.vms)
  • Re: Any advice for potty training??
    ... the ability to know when she needs to go and try to get to ... opinion) helps kids get the connection between physical ... in the way of this connection. ... I just wanted some advice... ...
    (misc.kids)
  • Re: OT: ADSL Routers
    ... >wireless, just the ability for both machines to use the connection, and ...
    (uk.rec.motorcycles)
  • Exporting access data from a remote server
    ... I am running an access XP database on a shared Win2k server and want to give users the ability to download the results of queries as spreadsheets. ... after Set Conn = CreateObject ... I'm assuming that once the connection exists, ...
    (microsoft.public.inetserver.iis)