Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

getting a Message from Net::YMSG

by premak (Novice)
on Aug 01, 2006 at 12:00 UTC ( [id://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/YMSG.pm line 344." all the time. This is the code i have writtern.
my $yahoo = Net::YMSG->new( pre_login_url => 'http://msg.edit.yahoo.com/config/', hostname => 'cs.yahoo.com', 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
Prem

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 YMSG.pm 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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2024-04-25 01:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found