Python socket: does not recieve anything
Hi LQers,
I am new to sockets in general. I have a program that is supposed to listen for udp packets sent to the broadcast address. I can see (sniffing with wireshark) that the packets are comming accross the interface, but nothing is returned. I do not know how to debug this problem or if any this is poorly configured or what. Any suggestions would be great. PHP Code:
Steve |
is that all your code? take a look at the HOWTO for more info
|
ghostdog,
thanks for the response. No, that is not all of my code. (The actual full program includes around 800 lines of code) Most of it is not related to my socket issue, but I did realize I may have left out key part of my problem. Before I listen on the socket, I send a message: PHP Code:
Here is a very useful guide that I started with: http://www.scribd.com/doc/134861/Soc...ng-with-python The man page for socket is also useful. |
Well I have figured out my problem:
It was not related to my socket code. It was related to the address I was attempting to bind to. My linux box has 4 interfaces. I used bind to specify which interface to use. I then sent a broadcast packet. The response is not sent to my address (that I specified in the the bind() ), but to 255.255.255.255. My new problem: how do I specify an interface and listen for broadcast messages? |
I'm going to just use two sockets: one for sending and a second for listening to the broadcast address.
|
All times are GMT -5. The time now is 06:10 PM. |