> Hi all > > Silly question but I have two Nic cards in my system and I want my perl > program to use my second nic e.g. eth1 not eth0 as it is now. > > Thank you > > Ben >
Assuming context of: Modern unix-or-unix-like-system. There is no portable way to force the network stack to prefer a given interface at the client-application level. A call to connect(3) in the library will select the near endpoint based on the destination IP-addr. Server applications (i.e. those that use bind(3) ) can pass in an address in lieu of INADDR_ANY to force them to only listen on a given address. Getting the IP-addresses for the various interfaces on your system is left as an exercise to the user. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them into the correct order. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>