Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: raw sockets

by Anonymous Monk
on May 06, 2014 at 11:17 UTC ( [id://1085160]=note: print w/replies, xml ) Need Help??


in reply to raw sockets

Perl's raw socket functions more or less mirror the underlying system calls. So when you're looking for documentation, you can Google something like "linux bind to interface", which would lead you to this Stack Overflow answer, which leads you to the SO_BINDTODEVICE option, which is documented in the socket(7) manpage.

However, from what I can tell the SO_BINDTODEVICE is not available on all OSes, and it's also not available in the Socket module. See this thread for how you could hack it.

On the other hand, why are you using the low-level functions, when there are higher-level modules such as IO::Socket and the Net:: family around? Also, I think it's much more common to bind your socket to a specific address instead of directly to an interface. Why do you need to bind to a specific interface?

Replies are listed 'Best First'.
Re^2: raw sockets
by Anonymous Monk on May 06, 2014 at 11:33 UTC
    That was very helpful, thank you very much.
    I'm gonna carefully research all the links you've provided.
    "bind to interface" due to the bridging.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1085160]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-24 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found