By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,931 Members | 2,015 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,931 IT Pros & Developers. It's quick & easy.

python broadcast socket

P: n/a
I'm sort of new to both Python and socket programming so I appologize ahead of time if this is a dumb question. I have found that the following code works on windows but on linux I get an exception.

import socket
s = socket.socket( socket.AF_INET, socket.SOCK_DGRAM )
s.connect( ( '<broadcast>', 1617 ) )

The exception I get is:

socket.error: (13, 'permission denied')
I have tried this on three Linux machines. All firewall software is disabled.
Thanks for you time and patience.

Ron

Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 2005-06-29, <ro****@cox.net> <ro****@cox.net> wrote:
I'm sort of new to both Python and socket programming so I
appologize ahead of time if this is a dumb question. I have
found that the following code works on windows but on linux I
get an exception.

import socket
s = socket.socket( socket.AF_INET, socket.SOCK_DGRAM )
s.connect( ( '<broadcast>', 1617 ) )

The exception I get is:

socket.error: (13, 'permission denied')


Sending broadcast packets is a dangerous thing and not
something a normal user should be able to do. In a real OS,
it's a restricted operation and you need special privledges.

Under Linux, you need to be root to send a broadcase packet.

--
Grant Edwards grante Yow! How's the wife? Is
at she at home enjoying
visi.com capitalism?
Jul 19 '05 #2

P: n/a
Grant Edwards wrote:
Under Linux, you need to be root to send a broadcase packet.


I don't think this is true.

--Irmen
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.