sockets: why doesn't my connect() block?

7stud bbxx789_05ss at yahoo.com
Sun Nov 18 12:40:10 EST 2007


On Nov 18, 8:18 am, Jean-Paul Calderone <exar... at divmod.com> wrote:
> On Sat, 17 Nov 2007 21:32:50 -0800 (PST), 7stud <bbxx789_0... at yahoo.com> wrote:
> >According to "Python in a Nutshell(2nd)", p. 523:
>
> >connect:   s.connect((host, port))
> >...
> >Blocks until the server accepts or rejects the connection attempt.
>
> >However, my client program ends immediately after the call to
> >connect()--even though my server program does not call accept():
>
> Your platform's TCP implementation acknowledges the connection attempt
> before your application calls accept().  This is fairly usual.
>
> Jean-Paul

Has my platform rejected or accepted the connection?  If it accepted
the connection, then why do I  have to call accept()?  Or is "Python
in  Nutshell" wrong?




More information about the Python-list mailing list