Steve Holden wrote:
> Skink wrote:
>
>> Sion Arrowsmith wrote:
>>
>>> conn.sendall(struct.pack("!i", len(data)) + data)
>>>
>>> or after creating conn
>>>
>>> conn.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1)
>>>
>>> to disable Nagle.
>>>
>>
>>
>> Sion,
>>
>> thank you for your help,
>>
>> it
Skink wrote:
> Sion Arrowsmith wrote:
>
>>conn.sendall(struct.pack("!i", len(data)) + data)
>>
>>or after creating conn
>>
>>conn.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1)
>>
>>to disable Nagle.
>>
>
>
> Sion,
>
> thank you for your help,
>
> it works but...
> it works when client & se
Sion Arrowsmith wrote:
>
> conn.sendall(struct.pack("!i", len(data)) + data)
>
> or after creating conn
>
> conn.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1)
>
> to disable Nagle.
>
Sion,
thank you for your help,
it works but...
it works when client & server is in python
i tried both s
Bryan,
>
> Sion Arrowsmith is right about what causes the delay.
> Just in case your real code looks like this, I'll note:
>
>> len, = struct.unpack("!i", s.recv(4))
>> data = s.recv(len)
yes, my mistake ;)
>
>
> First, you almost certainly don't want to use the name 'len'.
> Ought not
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.
t
Skink wrote:
[...]
> what's wrong here?
Sion Arrowsmith is right about what causes the delay.
Just in case your real code looks like this, I'll note:
> len, = struct.unpack("!i", s.recv(4))
> data = s.recv(len)
First, you almost certainly don't want to use the name 'len'.
Ought not to b
In article <[EMAIL PROTECTED]>, Skink <[EMAIL PROTECTED]> wrote:
>Hi,
>
>I'm preparing a python server that sends java classes and resources to
>custom java class loader. In order to make it faster I don't want to use
>URLClassLoader that uses HTTP protocol 1.0 and for each class/resource
>creates
In article <[EMAIL PROTECTED]>, Skink <[EMAIL PROTECTED]> wrote:
>% python client.py client.py client.py client.py server.py server.py
>init 0.00066089630127
>client.py 0.000954866409302
>client.py 0.0408389568329
>client.py 0.0409188270569
>server.py 0.0409059524536
>server.py 0.0409259796143
>
>
Hi,
I'm preparing a python server that sends java classes and resources to
custom java class loader. In order to make it faster I don't want to use
URLClassLoader that uses HTTP protocol 1.0 and for each class/resource
creates own connection.
Instead I'd like to use raw sockets with simple protoco