I have a client that uses IO::Socket to create a socket to a
server on another machine and exchange data on that socket. The server is fussy about what IP addresses it will accept
connections from, and as the machine running the client uses IP aliasing I need to be able to set which IP address the client connection goes out on.
I can't find anything in the documentation for IO::Socket or in the man pages for the socket system calls that might help me, and all the web searches I have tried come up with nothing relevant.
Any ideas welcome.
The client code starts:
my $sock = IO::Socket::INET->new("10.0.0.1:5015") or die "$!\n";
# Write and read messages to socket.
The machine runs Linux (Debian Woody with 2.4.20 kernel)
and Perl (5.6.1). This is the output of ifconfig:
eth0 Link encap:Ethernet HWaddr 00:E0:81:B4:77:83
inet addr:10.0.0.148 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:0 Link encap:Ethernet HWaddr 00:E0:81:B4:77:83
inet addr:10.0.0.149 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.