strange sockets

Skink spam at me.please
Mon Nov 7 02:24:22 EST 2005


Sion,

> Solutions: either change
> 
> 
>>       conn.sendall(struct.pack("!i", len(data)))
>>       conn.sendall(data)
> 
> 
> to
> 
> conn.sendall(struct.pack("!i", len(data)) + data)
> 
> or after creating conn
> 
> conn.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1)
> 
> to disable Nagle.

thank yuo so much, both solutions work perfect!

%python client.py client.py client.py client.py
init 0.00101184844971
client.py 0.000586986541748
client.py 0.000448942184448
client.py 0.000470161437988

I think that I'll use the second one


skink



More information about the Python-list mailing list