Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How to set a timeout for the socket filehandle generated by POE::Wheel::SocketFactory ?

by rcaputo (Chaplain)
on Dec 30, 2008 at 06:16 UTC ( #733191=note: print w/replies, xml ) Need Help??


in reply to How to set a timeout for the socket filehandle generated by POE::Wheel::SocketFactory ?

The socket is just a plain Perl socket, so all Perl socket rules apply. Whatever normally works for your operating system should be fine.

POE::Wheel::ReadWrite will send an ErrorEvent as soon as the socket reports a problem.

The "Invalid argument" error means that one of your parameters to setsockopt() is incorrect, but it doesn't say which. You should inspect the parameters to verify they're correct for your operating system.

  • Comment on Re: How to set a timeout for the socket filehandle generated by POE::Wheel::SocketFactory ?

Replies are listed 'Best First'.
Re^2: How to set a timeout for the socket filehandle generated by POE::Wheel::SocketFactory ?
by sunshine_august (Scribe) on Dec 30, 2008 at 06:41 UTC
    Here is my OS:
    [larry@localhost ]$ uname -a Linux localhost 2.6.21 #1 SMP Mon Nov 3 16:32:36 CST 2008 x86_64 x86_6 +4 x86_64 GNU/Linux
    and I add the setsockopt line just like the following reference:
    http://perldesignpatterns.com/?SocketProgramming

    I can't figure out which param is the evil :(.

      You didn't use the same pack() pattern that perldesignpatterns.com does. That page shows pack('LL', 15, 0) while your original example uses 'll'. Uppercase 'LL' and lowercase 'll' are a bit different.

      Perhaps more importantly, that page explains why it uses 'LL' and how to determine what should work for you. The instructions look good, so I recommend following them (if you haven't already).

      You may wish to carefully compare the example with your code. You may be overlooking some other difference.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2022-09-30 23:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (126 votes). Check out past polls.

    Notices?