need a thread to keep a socket connection alive?

nephish at xit.net nephish at xit.net
Mon Apr 24 13:39:12 EDT 2006


ok, thanks for all the suggestions, gents, i clearly have more to read
on this.
i have discovered that the server will send a request for the heartbeat
ping if its almost timed out, so i use the length of the message to
determine what to do with it.

msg = sockobj.recv(1024)

if len(msg) == 158:
    record the data
elif len(msg) == (34): # length of request for ping
    ping the server
else:
    yada yada.

each real message ( according to their docs ) should be exactly 158
bytes.

i know i need to look more into all of this.. but thanks for all of
your help

-shawn




More information about the Python-list mailing list