Re: connect() to localhost non-blocking.

Patrick Mau (mau@oscar.prima.de)
Mon, 22 Oct 2001 17:49:59 +0200


On Sun, Oct 21, 2001 at 04:18:10PM -0700, Dan Kegel wrote:
> > Patrick Mau <mau@oscar.prima.de> writes:
> >

[Snip]

> You have to be prepared to handle both immediate and delayed
> connection, especially if you want to be portable. (Solaris behaves
> a bit differently than Linux in this regard.) See
> http://www.kegel.com/dkftpbench/dkftpbench-0.37/ftp_client_pipe.cc
> for an example of how to handle nonblocking connects more or less portably.
> (You have to wade through quite a bit of code, tabstops 4, to find
> all the connect-handling stuff -- sorry.)
> - Dan

Hallo Dan,

thnaks for the pointer and your remarks, but I really
wondered if linux _never_ immediatly accept()'s connections.

I never saw a connect() call returning 0 (connected) on a
non-blocking socket. Always EINPROGRESS. I guess I have to
look at the kernel to see scheduling effects ...

thanks,
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/