> immediately responding by returing a value to the application that made the
> connect() system call. The value returned, i.e., return value of connect(),
> indicates that the request to establish a TCP connection was not successful.
I don't think this is a failure case. The program has requested a connect.
The OS has accepted the request and has started sending the connection
setup message (SYN packet) to the remote end, but, because the call was
non-blocking, it couldn't wait for the initial message exchange to
complete, so it doesn't know whether or not it really will be successful,
so it returns an equivocal answer.
That's certainly how the Linux source code (inet.c) works.
(The reason that Lynx uses non-blocking calls is so that it can
watch the keyboard whilst waiting for the network.)