Re: Letting a Python application phone home



Am Freitag, 14. Juli 2006 15:26 schrieb Dieter Vanderelst:

This is surely possible. You need to define a protocol for the communication
between client and server. As you are planning to send data over the internet
you should build it on top of tcp. Look at the python module "socket" resp.
"SocketServer" for low level tcp functions.

As the data should not be visible to everyone you need some kind of
encryption. Either you rely on the ssl capabilities of the "socket" module,
this way securing the transport layer (tcp) or you build encryption into your
newly designed application layer protocol. For the latter have a look at the
"python cryptography toolkit". Sorry I have no url at hand, simply google.

Concerning the question of stopping the program when the internet connection
breaks: let your program contact the server periodically. If this fails quit
the program.

Regards

Nils
.



Relevant Pages

  • Re: network programming: how does s.accept() work?
    ... The articles and books I've read all claim that the server ... port 5053 is a 'listening' port only. ... the server creates a new socket for communication between the client ... on the network, and in the RFCs which define the TCP protocol (UDP too, but ...
    (comp.lang.python)
  • Re: Detecting when a socket has been closed.
    ... shutdown the server closing the socket the client still thinks the socket is open. ... First send will not throw exception, because there is no way for TCP stack to know that other end has actually closed its receiving side. ... It takes some time for packet to reach other side and return information that server side is gone. ... in case other end has closed socket and network is still operating after first send TCP RST segment will be returned to TCP stack notifying it connection has gone down. ...
    (microsoft.public.dotnet.languages.csharp)
  • HEADS UP: network stack and socket hackery over the next few weeks
    ... Over the next few weeks, I'll be doing a fairly serious workworking of the socket and protocol reference models, in order to clean up a number of long-standing race conditions and provide infrastructure for significant locking optimizations for several protocols (including TCP). ...
    (freebsd-current)
  • Re: client socket to read individual messages
    ... connection where I am able to understand individual messages sent by ... defining a protocol, and message-length ... I recently had to devise a simple protocol of my own for a socket situation. ... and one classic solution for that problem is to write a little server ...
    (comp.lang.java.programmer)
  • Re: I want to write a network printer server...
    ... Then why not just make your printer a shared printer? ... server of your devising, so you can make it do anything you want. ... Open a socket, start sending data. ... you could use a protocol where you send the ...
    (microsoft.public.vc.mfc)