Re: Problem signing on to AIM with Net::AOLIM
- From: Rick Sanders <rfs9999@xxxxxxxxxxxxx>
- Date: Mon, 10 Oct 2005 21:18:04 GMT
J. Gleixner wrote: > Post real code.
What do you mean 'post real code'? The code in my post is the same code I am trying to run, except that I have obscured the username and password.
>> exit; > > Not needed.
Of course it's not needed but an exit statement at the of a Perl script does no harm and it makes clear to the reader the point at which the main part of the code ends.
> Check if this failed, before setting error.
> unless ( $aim->signon )
> {I was trying to boil my script down to the bare essentials to illustrate the problem I am trying to fix. In an earlier version I had the following:
$aim->signon;
unless ($aim->signon) {
$errstr = $Net::AOLIM::ERROR_MSGS{$IM_ERR};
print "Signon failed: $errstr (IM_ERR = $IM_ERR)\n";
exit;
} else {
print "Signon successful\n";
}
> Maybe you need to set the server? Never used it, however a quick read > through the documentation shows the default server as:
Yes, I did try setting the toc and login server names and ports explicitly:
my $aim = Net::AOLIM->new(
"username" => $username,
"password" => $password,
"server" => "toc.oscar.aol.com",
"port" => 1234,
"login_server" => "login.oscar.aol.com",
"login_port" => 5198,
"login_timeout" => 5,
"callback" => \&handler,
);
Thanks, Rick
Rick Sanders wrote:
I am having trouble getting my script to sign onto to the AOL Instant Messenger server. Using the example in the Net::AOLIM script I get $IM_ERR =6 ("login timeout"). I am able to telnet to the AOL login server port (login.oscar.aol.com port 5198) and it responds so it's not a firewall problem. I have tried this from both Windows XP and Solaris with the same results.
Here is the code I am using. I would be grateful if someone could point out what I am doing wrong. Thanks.
-Rick
#!/usr/bin/perl -w
use Net::AOLIM; use Strict;
Post real code.
$user = 'my name'; $pass = 'my password'; $aim = Net::AOLIM->new( 'username' => $user, 'password' => $pass, 'login_timeout' => 5, 'callback' => \&handler ); $aim->signon;
Check if this failed, before setting error. unless ( $aim->signon ) {
$error = $Net::AOLIM::ERROR_MSGS{$IM_ERR}; print "signon status $error\n";
}
exit;
Not needed.
sub handler {
print STDOUT "This is the handler\n"; exit; }
Maybe you need to set the server? Never used it, however a quick read through the documentation shows the default server as:
'server' => servername (default toc.oscar.aol.com)
That server and the 'login.oscar.aol.com', you refer to, are two different IPs.
.
- Follow-Ups:
- Re: Problem signing on to AIM with Net::AOLIM
- From: J. Gleixner
- Re: Problem signing on to AIM with Net::AOLIM
- From: A. Sinan Unur
- Re: Problem signing on to AIM with Net::AOLIM
- References:
- Re: Problem signing on to AIM with Net::AOLIM
- From: J. Gleixner
- Re: Problem signing on to AIM with Net::AOLIM
- Prev by Date: Re: Perl LWP, logging into yahoo etc ?
- Next by Date: PAR gone?
- Previous by thread: Re: Problem signing on to AIM with Net::AOLIM
- Next by thread: Re: Problem signing on to AIM with Net::AOLIM
- Index(es):
Relevant Pages
|