On Saturday 04 March 2006 5:58 pm, Jay Strauss wrote:
> Hi,
>
> I'm not sure what's going on here.  I have a simple script that reaches the
> end (and prints out "here") but the script never ends and I have to ctrl-c
> it.
>
...

Figured it out.  If I stick one more 

$api->ProcessNextCallback();
in the "else" it terminates:

while ((my $rc = $api->WaitForCallback(1)) > -1){

    if ($rc > 0){
        $api->ProcessNextCallback() ;
        last if ! $tws->get_EClientSocket->isConnected();
    }
    else {
         # A timeout has occured after, in this case, 5 secs.
        print "5 seconds have passed, still waiting for callback...\n" ;
        $client_socket->eDisconnect();
        $api->ProcessNextCallback(); 
        #$api->WaitForCallback(5);
    }
}

Reply via email to