[Twisted-Python] twisted and gprs

Carl Zmola zmola at acm.org
Wed Jan 10 07:26:51 MST 2007

John Aherne wrote:
> Carl Zmola wrote:
>> John Aherne wrote:
>>> Phil
>>> Thanks for the reply.
>>> I'm obviously missing some obvious point I think.
>> I think the obvious point is that: Everything works find while the 
>> TCP socket is open.  The server knows everything about the client at 
>> that time.  Keep alives are sent  to keep the connection open.
>> The only problem occurs when the connection is closed.  The client 
>> must be responsible for re-establishing the connection, since the 
>> server can not reach the client.
>> To make matters more fun, the client will not always know the 
>> connection is down unless the client is sending keep alives (with a 
>> watchdog timer going).
>> After you figure this all out, you can worry about UDP. UDP would 
>> only be useful in this situation when the client is pumping data to 
>> the server and does not need an immediate response, since the server 
>> may not be able to send UDP data to the client.  A good example would 
>> be position updates.  The client could send position updates every 
>> minute via UDP and connect via TCP every 15 minutes to guarantee the 
>> messages got through.
>> You should probably get familiar with IP, UDP and TCP framing and 
>> byte counting if you are working with GPRS.  Bytes can start to add 
>> up if you don't pay attention to them.
>> Carl
>> _______________________________________________
>> Twisted-Python mailing list
>> Twisted-Python at twistedmatrix.com
>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> Carl
> Thanks for the reply.
> I think the client can check its local IP address. If that has changed 
> then it will know it has lost and regained its connection. It can then 
> reconnect to the server. I'm not sure if this is cast in stone, but I 
> can imagine a case where it might not apply.
> OK, I have been looking up frame sizes etc. And I have been looking at 
> the data sent through an ethernet analyser just to confirm what 
> actually goes down the line.
> Thansk for the advice.
A great reference is W. Richard Stevens's book TCP-IP Illustrated.

Also, just play with it a little on a wired connection and unplug you 
Ethernet cable to see what happens.
> John Aherne
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

More information about the Twisted-Python mailing list