[Twisted-Python] twisted and gprs
zmola at acm.org
Wed Jan 10 00:23:21 EST 2007
John Aherne wrote:
> 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
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
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.
More information about the Twisted-Python