Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client stops "listening" after 30-60 minutes #4

Open
hiattp opened this issue Jun 24, 2012 · 3 comments
Open

client stops "listening" after 30-60 minutes #4

hiattp opened this issue Jun 24, 2012 · 3 comments

Comments

@hiattp
Copy link

hiattp commented Jun 24, 2012

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!

@pbouchet
Copy link

pbouchet commented Jul 3, 2012

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 :)

@hiattp
Copy link
Author

hiattp commented Jul 9, 2012

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:

#4 (comment)

@Jaapze
Copy link

Jaapze commented Aug 4, 2014

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants