Could someone show me a sample how to flush the socket sending buffer? Thanks a lot.

mike needpassion at gmail.com
Fri Jun 8 18:36:30 EDT 2007


I have called the setsockopt() to set no delay after connecting like
this way:

        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect(('192.168.10.1', 21980))
        s.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 0)
        s.send("abc at abc.com\n")
        s.send("123 at hbc.com\n")
        ......

but still, the server can only receive the first line, and keep
waiting for the second line. So, in my mind the second line is still
in the sending buffer, and not reach the server side.

Any hints would be appreciated.

Mike




More information about the Python-list mailing list