creating RAW sockets

Nobody nobody at nowhere.com
Thu Mar 17 02:14:54 EDT 2011


On Wed, 16 Mar 2011 22:36:07 -0700, moijes12 wrote:

> Traceback (most recent call last):
>   File "getsockopt_handler.py", line 7, in ?
>     send.bind((gethostbyname(gethostname()),50000))
> socket.error: (99, 'Cannot assign requested address')

Specifying a port number isn't meaningful for a raw socket. At the kernel
level, the sin_port field in a sockaddr_in structure is used for the IP
protocol (e.g. 6 for TCP), if it's used at all.




More information about the Python-list mailing list