socket problem

Jean-Paul Calderone exarkun at divmod.com
Mon Mar 2 16:05:03 CET 2009


On Mon, 2 Mar 2009 06:40:57 -0800 (PST), step <fxlzju at gmail.com> wrote:
>  my server program is writed with c in windows using mingw,using
>"select" model
>
> client is writed with python
>
> the problem is , when the client connect the server, the function
>FD_ISSET(cilentfd,&set) always true, but it hvae read no data, i also
>no send data to server.
>
> why? i use telnet program in windows to test my server ,it
>good ,FD_ISSET  is work ok, it return false

Perhaps there is a bug in your C program and it only works sometimes.
There is *no* misuse of socket APIs which the Python client could be
committing which would cause a correctly written server (in C or any
other language with BSD socket APIs) to fail.  I suggest investigating
how telnet and your Python client differ, then looking into the C code
to find out how that difference can trigger a bug in it.

Jean-Paul



More information about the Python-list mailing list