Hello,
>>I am using opensrs-PHP, so I am implementing the api with the use of the
>>openSRS_base class. When I search through the API manual I am unable to find
>>anything pertaining to closing a connection/killing a connection/logging out.
>>Based upon the manual after 100 commands (I get the following error after 33
>>calls to my function) are completed you must re-authenticate:
>>"Number of command per connection exceeded limit. Client must re-authenticate
>>with server."
>
> It is probably safe to destroy the current instance by replacing it with
> a new one.
>
> It might be simpler to do this every 5 to 10 passes.
>
> Frankly, I'm surprised that the opensrs class code doesn't re-connect
> automatically for you.
>
I had the exact same problem with opensrs-php.
I was able to get around that problem. It's being handled automatically now.
In my custom class which derives from openSRS_base, I override the
send_cmd function like this:
function send_cmd($command)
{
$response = parent::send_cmd($command);
// a response_code of 350 means we reached the 100 limit.
if ( $response["response_code"] == 350 ) {
$this->close_socket();
$response = parent::send_cmd($command);
}
return($response);
}
I hope this helps.
--
Christian Roy <[EMAIL PROTECTED]>
Station InfiniWeb inc.
http://www.infiniweb.ca/
/* Commerce électronique - Sites Web - Développement de solutions Web */
/* e-Commerce - Websites - Web Solutions development */
_______________________________________________
domains-dev mailing list
[email protected]
http://discuss.tucows.com/mailman/listinfo/domains-dev