Re: Problem signing on to AIM with Net::AOLIM



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.
.



Relevant Pages

  • Re: Session problem
    ... it was a leftover from various test i've made before ... Also i forgot to mention that on a server with php5 it was working ... I've put exit after the header. ... otherwhise the execution of the script is not stopped. ...
    (comp.lang.php)
  • Re: Shutdown function
    ... know in shutdown function that this error occured. ... I just want to know if script ends correctly or not (if there were ... I call exit(1), How to get in shutdown functino that exit status was 1. ... output by the server and NOT the script ...
    (comp.lang.php)
  • Re: Script gesucht: sispmctl schaltet Steckdose -- Backup beginnt...
    ... Komisch -- auf meinem Notebook ging es nicht aber auf dem Server, wo das script eh laufen wird, ging es .. ... trap cleanup EXIT TERM INT ...
    (de.comp.os.unix.shell)
  • Using perl to check services
    ... I wrote this little script to check to see if our Lotus Notes servers are ... Internal Server Error ... close $sock or die "close: ...
    (comp.lang.perl)
  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)