S
Susanne West
how can i select an specific ethernet card for a
socket, when i have multiple ethernet-cards (lan,
wireless) installed?
i have two cards, configured for two different subnets:
wireless: 192.168.50.x
lan: 2.1.1.x
and want to open a socket and broadcast to 2.1.1.x but
without touching the wireless-settings. currently, i
do:
----------------------------------------------
my $sendsocket = new IO::Socket::INET(
LocalHost => '2.1.1.1',
LocalPort => '6454',
PeerAddr => '2.255.255.255',
PeerPort => '6454',
Proto => 'udp',
Broadcast => 1
) || die "[ERROR CREATING SOCKET] $!\n";
$sendsocket->sockopt(SO_BROADCAST, 1);
----------------------------------------------
which causes the wireless-connection to collapse...
i guess i can do something with 'bind' but can't
figure out how to identify the correct card...
thanks a ton!
socket, when i have multiple ethernet-cards (lan,
wireless) installed?
i have two cards, configured for two different subnets:
wireless: 192.168.50.x
lan: 2.1.1.x
and want to open a socket and broadcast to 2.1.1.x but
without touching the wireless-settings. currently, i
do:
----------------------------------------------
my $sendsocket = new IO::Socket::INET(
LocalHost => '2.1.1.1',
LocalPort => '6454',
PeerAddr => '2.255.255.255',
PeerPort => '6454',
Proto => 'udp',
Broadcast => 1
) || die "[ERROR CREATING SOCKET] $!\n";
$sendsocket->sockopt(SO_BROADCAST, 1);
----------------------------------------------
which causes the wireless-connection to collapse...
i guess i can do something with 'bind' but can't
figure out how to identify the correct card...
thanks a ton!