[python-win32] remote copy with compress/decompress

python at kareta.de python at kareta.de
Wed Dec 15 20:47:20 CET 2004


Hello Jens, hello all,

thanks for your replay. I tried your solution first and get some errors.
Independing of the size in socket.recv and f.read  I allways get an empty
datastring after 1770 bytes. But I found a similiar solution here
http://mail.python.org/pipermail/python-list/2002-July/111754.html. This code
uses struct instead of pickle and that works for me. I don't know if one of this
solutions has some advantages/disadvantages, but I will try it laiter again with
pickle.

But I have some more questions:
1) If the serverside runs in  inifitiv loop, the 'break into running code'
funktion of pythonwin doesn't works, because it is a system call. Is there a way
to stop the programm using a shortcut ?

2) Maybe I want to install the serverside as a service like it is described in
Mark's book. Then step 1) can be solved by stopping the service. Is it save to
run it this way:

>s = socket(AF_INET,SOCK_STREAM)
>s.bind(('',PORT))
>s.listen(1)
>while True:
>   q,v = s.accept()
>   ... rest of code, s and q are not closed

or have I to use threads or what ever else to make sure that the socket is still
listening ? When I tried this code, I get sometimes 'conection refused' errors
after the serverside runs for longer time.

regards,
Jürgen

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/


More information about the Python-win32 mailing list