From: Brian G. <br...@ge...> - 2006-09-14 00:14:07
|
I added some reconnection logic to libplayerc. The idea is that if your network connection drops out, or is unreliable or slow, rather than just giving up, your client program can automatically try to reestablish a connection to the server. If a connection can be made, then all of your device subscriptions will be reestablished. TODO includes: - reestablish message replacement rules - reset data delivery mode - other persistent state to be set? The new code is checked in on HEAD, and I'll port it to 2.0.x once I'm convinced that it's stable. To that end, I'd appreciate any feedback you can provide, if you get a chance to try it out. Also, there's some tricky signal handling going on, so you may encounter compilation problems. Let me know if you do. In libplayerc: Set the retry limit, which is the number of times we'll try to reconnect after a socket error, before giving up. Set limit to -1 for infinite retry, 0 for no retries (the default). playerc_client_set_retry_limit(playerc_client_t* client, int limit); Set the retry sleep time, which is the number of seconds to wait between consecutive retries (default: 2.0). Depending on the system, this delay may occur in addition to the delay set by playerc_client_set_request_timeout(), which is used in calling connect (). playerc_client_set_retry_time(playerc_client_t* client, double time); In libplayerc++: PlayerClient::SetRetryLimit(int limit); PlayerClient::SetRetryTime(double time); brian. |