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
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to