ArduinoPusherClient icon indicating copy to clipboard operation
ArduinoPusherClient copied to clipboard

client stops "listening" after 30-60 minutes

Open hiattp opened this issue 12 years ago • 3 comments

this is an awesome library! I'm trying to use it for a little water turret project (turret.jit.su). I haven't modified any of the connection code from your example, but I'm noticing that after leaving the board on, after roughly an hour it stops responding to messages from Pusher. I'm logging whether or not client.connected() is false in the loop but it it doesn't seem to be the issue (client.connected() is apparently still true while the board is unresponsive).

Do you know what might cause this (where I should start troubleshooting)? Thanks!

hiattp avatar Jun 24 '12 16:06 hiattp

The most recent version of the Pusher API send ping events to check whether your client is still connected. If you don't respond with a pong it considers you to be disconnected. See the Pusher documentation, it might help you with your problem :)

pbouchet avatar Jul 03 '12 21:07 pbouchet

Interesting yeah this looks like a good place to start I'll check it out, thanks for the pointer!

On Tue, Jul 3, 2012 at 5:03 PM, Pierre Bouchet < [email protected]

wrote:

The most recent version of the Pusher API send ping events to check whether your client is still connected. If you don't respond with a pong it considers you to be disconnected. See the Pusher documentation, it might help you with your problem :)


Reply to this email directly or view it on GitHub:

https://github.com/krohling/ArduinoPusherClient/issues/4#issuecomment-6746438

hiattp avatar Jul 09 '12 16:07 hiattp

Just do it like so: if( Pclient.connect(key) ) { Pclient.bind("pusher:ping", pingpong); }

void pingpong(String data) { Pclient.triggerEvent("pusher:pong", "{}"); }

Jaapze avatar Aug 04 '14 12:08 Jaapze