[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Telnet-like Chat Program



On Wed, Jun 08, 2005 at 11:30:18AM +0100, Dan wrote:
> > My own searching suggests I should get either an Ethernet hub
> > or simply an Ethernet cable, and plug the two computers together. They're
> > then supposed to automatically assign themselves IP addresses.
> 
> I've never heard of that, but there is such a thing as DHCP (Dynamic
> Host Configuration Protocol, I think) which allows them to request IP
> addresses from a third machine (automatically, without first having to
> be told where the third machine is).
>
> I really think that you won't have to worry about IP addresses, because
> they are a part of the operating system.

You should not have to even know your own IP address. You just want to 
open a particular TCP port and listen for incoming connections. it is 
the responsibility of the other computer that connects to you to figure 
out what your IP address is (regardles of whether it is DHCP configured 
or manually configured)

You should probably check out TCPServer from the SocketServer module in 
the standard library. See 
http://docs.python.org/lib/module-SocketServer.html

---
Bob the Hamster