udp broadcast example, please

T

Torsten Rueger

Moi,

sorry, but I've searched and searched to find exact information on how
to do a simple udp broadcast client/server, but can find it:

I want to have a thread pinging (very small message) and possibly the
same thread receiving maybe with a 1 second timeout. And the same code
should be able to run as multiple instances on the same machine.

Could someone with experience please post the 10 lines to make this
happen. Please no general comments or things that "should" work. I've
tried for hours with various socket options and addresses, so I would
very much appreciate working code.

Thanks
Torsten
 
I

Irmen de Jong

Torsten said:
sorry, but I've searched and searched to find exact information on how
to do a simple udp broadcast client/server, but can find it:

Have you searched on your hard drive?
It's right there: Demo/sockets/udpecho.py
in the python source tree.

--Irmen
 
M

Matthias Baas

sorry, but I've searched and searched to find exact information on how
to do a simple udp broadcast client/server, but can find it:

I want to have a thread pinging (very small message) and possibly the
same thread receiving maybe with a 1 second timeout. And the same code
should be able to run as multiple instances on the same machine.

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52302

There's an example how to send and receive UDP packets.

- Matthias -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top