hi, I don't use python very often, and I don't have a lot of experience with network programming either. A friend of mine came up with a problem, and I was wondering if anyone could help out:

"I need to connect to another computer with a UDP socket and TCP/IP socket. Although I know how to do this, I need to know how to broadcast a request to connect to a hosting socket (using the UDP socket), have another computer be able to search for any requests to connect, and then establish a one-on-one connection between the computers (using the TCP/IP socket); all of this done over a local network. In a nutshell, connecting two computers over a local network."

Any help is much appreciated, thanks!

You need a basic client and server ...YOu can get short code anywhere...

Here is a great article which explains all the basics and also gives you the shortest possible code for both a client and a server, even a server which can accept several clients using threads... Run server first and then client and you can see anything and then change the functions to send different data (it's only an 'echo' example: server resends the data received to the client):

http://www.devshed.com/c/a/Python/Sockets-in-Python-Into-the-World-of-Python-Network-Programming/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.