Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by Anonymous Monk
on Apr 21, 2000 at 18:36 UTC ( [id://8376]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

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 perl.com forever, even read a bunch of free scripts, but I want to learn every option and method.

Ex: why doesn't this work?

getsockopt(TESTSOCK, SOL_SOCKET, SO_SNDTIMEO, 1);

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

Originally posted as a Categorized Question.

  • Comment on Where can I find resources about Socket, IO::Socket, IO::Socket::INET

Replies are listed 'Best First'.
Re: Where can I find resources about Socket, IO::Socket, IO::Socket::INET
by btrott (Parson) on Apr 21, 2000 at 19:25 UTC
    That's not what the perlfunc entry for *my* getsockopt says--mine says:
    getsockopt SOCKET,LEVEL,OPTNAME
    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).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://8376]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-20 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found