Perl-Sensitive Sunglasses | |
PerlMonks |
Re: No data received on client socketby caelifer (Scribe) |
on Sep 19, 2006 at 19:51 UTC ( [id://573804]=note: print w/replies, xml ) | Need Help?? |
Just a wild guess here. I notice that your code is executed within eval block. However, you do not check for its status, which means that you silence any errors and/or exceptions. Try to check for $@ in your last statement. Also, depending on the socket option, i.e. if your socket is nonblocking, you should check for EAGAIN system error to see if the socket is ready to be read. Better yet use select or its OO counterpart IO::Select to determine if socket is readable. Update: Fixed mixup between $! and $@, pointed out by ikegami
I usually use a function instead of eval block and return an array containing message, byte count and possible error. Such as in
So now our message reading routine looks like ...
Hope this helps with your problem here. BR
In Section
Seekers of Perl Wisdom
|
|