Reputation: 3537
I'm making a relatively simple program which will also be running on a few friends computers and they need to share some information. They will need to exchange ips in case they are changed via dhcp and maybe a few other things in the future, but right now that's it (this will likely be used to update the program if I ever change it too I figure).
If there's a better way, without having a middleman server, to keep them from losing the ip that would be helpful too, but worst case I can just call them up and ask since this would so rarely happen, if ever. Our isps renew every 30 days I believe, and they often keep the same one anyways, so I doubt that'll ever be an issue, but if so it's so rare it'd be a minor inconvenience.
I haven't done much network programming/scripting before so I'm not sure where to approach this from. I've used urllib/urllib2, and mechanize, but I'm guessing those, while they could work, are not an elegant solution. I was thinking the pcs would just communicate via a specified port and just listen through there, but I don't know what module would handle such a thing.
Thanks friends.
Upvotes: 1
Views: 272
Reputation: 122749
If change of IP address is your main concern, a service like dyndns.com would certainly be helpful. (You can get automatic clients as well, which will update your DNS entry when your IP address changes.)
After this for data transfer, you're probably better off using existing protocols (e.g. HTTP, FTP, ...). There's plenty of existing HTTP server libraries out there for example. Perhaps something based on this would be of interest: http://docs.python.org/library/basehttpserver.html
Upvotes: 2