Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Re: 2 problems using sockets perl 5.8 and mod_perl2 on Linux

by Thelonius (Priest)
on Jul 03, 2003 at 03:05 UTC ( [id://271059]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: 2 problems using sockets perl 5.8 and mod_perl2 on Linux
in thread 2 problems using sockets perl 5.8 and mod_perl2 on Linux

After much pondering, I think the problem is that you are initializing your bit vectors like this:
my $rin = 0;
but you should be doing this
my $rin = '';
When you say: $rin = 0; vec($rin, $fd, 1) = 1;, apparently the 0 is converted to the string "0" before the bit for $fd is set. This means that an extra bit will be set in each of your vectors.

Personally, I've never understood vec() well enough to want to use it. I always use IO::Select and can_read() rather than that. I highly recommend the IO::Socket and IO::Select methods because they are so easy to use and, I think, less error-prone.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 22:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found