hello,
I tried to implement a simple python XMLRPC service on a win32
environment (client/server code inserted below).
The profiler of the client told me, that a simple function call needs
about 200ms (even if I run it in a loop, the time needed per call stays
the same).
After analysing the problem with etherreal I found out, that the XMLRPC
request is transmitted via two TCP packets. One containing the HTTP
header and one containting the data. But the acknowledge to the first
TCP packet is delayed by 200ms.
I tried around on the server side and found out that if the server reads
exactly all bytes transfered in the first TCP frame (via socket.recv()),
the next socket.recv(), even if reading only one byte, needs about 200
ms. But if I read one byte less than transfered in the first TCP frame
and then reading 2 bytes (socket.recv(2)) there is no delay, although
the same total amount of data was read.
After some googling I found the website
http://support.microsoft.com/?scid=kb%3Ben-us%3B823764&x=12&y=15, which
proposed a workaround (modifing the registryentry for the tcp/ip driver)
that did work. But modifing the clients registry settings is no option
for us.
Is there anybody who nows how to solve the problem? Or is it even a
problem if the python socket implementation?
By the way: I testet Win2000 SP4 and WinXP SP2 with Python 2.3.3 and
Python 2.5.1 each.
CLIENT:
----------
import xmlrpclib
import profile
server = xmlrpclib.ServerProxy("http://server:80")
profile.run('server.test(1,2)')
SERVER:
----------
import SimpleXMLRPCServer
def test(a,b): return a+b
server = SimpleXMLRPCServer.SimpleXMLRPCServer( ('', 80) )
server.register_function(test)
server.serve_forever()
--
Mit freundlichen Grüßen,
Best Regards,
Robert Hölzl
BALTECH AG
Firmensitz: Lilienthalstrasse 27, D-85399 Hallbergmoos
Registergericht: Amtsgericht München, HRB 115215
Vorstand: Jürgen Rösch (Vorsitzender), Martina M. Schuster
Aufsichtsratsvorsitzende: Eva Zeising
begin:vcard
fn;quoted-printable:Robert H=C3=B6lzl
n;quoted-printable:H=C3=B6lzl;Robert
org:Baltech AG;Development
adr:;;Lilienthalstrasse 27;Hallbergmoos;;85399;Germany
email;internet:[EMAIL PROTECTED]
title:Mr.
tel;work:+49 (811) 99 88 1-18
tel;fax:+49 (811) 99 88 1-11
note;quoted-printable:Registergericht: Amtsgericht M=C3=BCnchen, HRB 115215=0D=0A=
Vorstand: Martina Schuster-R=C3=B6sch=0D=0A=
Vorstandsvorsitzender: J=C3=BCrgen R=C3=B6sch=0D=0A=
Aufsichtsratsvorsitzende: Eva Zeising
x-mozilla-html:TRUE
url:http://www.baltech.de
version:2.1
end:vcard
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com