Monks,

Since I now have a working TCP client and server running I am looking to incorporate IPv6 into my work. I'm not quite sure how to go about this. I am using the standard Perl Cookbook to make my servers and clients, basically with IO::Socket::INET

$server = IO::Socket::INET->new(LocalAddr => "$localHost:$socket_port +", Proto => $protocol, Reuse => 1, Listen => $conn) or die "Can't make $protocol server on port $socket_port: $@\n +"; print "Running on port $socket_port.\n" if $verbose;

So if am looking to incorporate Socket6 into my program, to have a different IP version get built, can I still use this code to generate it? Would I just need to import Socket6 in an instance that I need IPv6? I know in C you need to use AF_INET6 instead of AF_INET, but I can't quite figure out how to do this with Socket6.

I got directed to Socket6 in trying to search for IPv6 clients or servers, haven't found much in the way of examples for what I need to do yet. Any help is appreciated.

Thanks!


In reply to Getting IPv6 with the Cookbook by gokuraku

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.