Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

getting a Message from Net::YMSG

by premak (Novice)
on Aug 01, 2006 at 12:00 UTC ( #564977=perlquestion: print w/replies, xml ) Need Help??

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

Hi Monks,
I have been working with Net::YMSG. This module gives a message like "Operation now in progress at /usr/lib/perl5/site_perl/5.8/Net/ line 344." all the time. This is the code i have writtern.
my $yahoo = Net::YMSG->new( pre_login_url => '', hostname => '', id => '$config->get("login_name")', password => '$config->get("login_passwd")', ); $yahoo->login or die "Can't login Yahoo!Messenger"; $yahoo->send('abcd', 'Hello World!')

Thanks and regards

Replies are listed 'Best First'.
Re: getting a Message from Net::YMSG
by Lies of Society (Initiate) on Aug 01, 2006 at 15:12 UTC

    Hi. I've never used this module before, but that error you're getting is the stringified form of EINPROGRESS. I looked at line 344 of and found this:

    my $server = IO::Socket::INET->new( PeerAddr => $self->{hostname}, PeerPort => $self->get_port, Proto => 'tcp', Timeout => 30, ) or die $!;

    The IO::Socket modules store error messages in $@, unfortunately. Try changing $! to $@ on that last line to find out why your script is really failing.

    Keep in mind that it's perfectly normal for an operation (such as connect()) to return EINPROGRESS under non-blocking IO. If you supply a 'Timeout' value to IO::Socket::INET->new()--as the code above does--IO::Socket sets the socket to non-blocking mode, calls connect(), and connect() returns immediately, setting $! to EINPROGRESS. It then polls the socket continuously, waiting for it to become writable. If this doesn't happen within the allotted time specified by 'Timeout', it returns undef, setting $@ to "connect: timeout", which is probably the error you're dealing with.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2023-09-26 16:57 GMT
Find Nodes?
    Voting Booth?

    No recent polls found