Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Where can I find resources about Socket, IO::Socket, IO::Socket::INET

by Anonymous Monk
on Apr 21, 2000 at 18:36 UTC ( #8376=categorized question: print w/replies, xml ) Need Help??
Contributed by Anonymous Monk on Apr 21, 2000 at 18:36 UTC
Q&A  > network programming


I always run into questions about the use of some getsockopt() and the use of some of the methods in IO::Socket. I'd like to find an easy to understand reference to using Socket and IO::Socket. I've manned them, been to cpan, up and down forever, even read a bunch of free scripts, but I want to learn every option and method.

Ex: why doesn't this work?


When the description for getsockopt clearly states getsockopt SOCKET LEVEL OPTNAME VAL

I need a good tutorial - if anyone can give a hand, I'd surely appreciate a deviation from manuals that don't provide examples

Answer: Where can I find resources about Socket, IO::Socket, IO::Socket::INET
contributed by btrott

That's not what the perlfunc entry for *my* getsockopt says--mine says:

Are you talking about getsockopt or setsockopt? Sounds like the latter. But if you're writing it as getsockopt, that's the problem. :)

If you're using IO:Socket, this is much easier:

my $sock = IO::Socket::INET->new( Listen => 5, LocalAddr => 'localhost', LocalPort => 9000, Proto => 'tcp'); $sock->setopt(SO_SNDTIMEO, 1);
It acts on the SOL_SOCKET level.

In terms of a general resource--you said you've read the man pages. Have you read the man pages for the C functions that all this stuff is based on? Those might help you out. The options for setsockopt/getsockopt are in setsockopt(2).

Please (register and) log in if you wish to add an answer

  • 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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (5)
    As of 2020-09-20 12:30 GMT
    Find Nodes?
      Voting Booth?
      If at first I donít succeed, I Ö

      Results (121 votes). Check out past polls.