Skip to content

Make ping #130

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

Closed
pauloeduardosp opened this issue Oct 9, 2016 · 8 comments
Closed

Make ping #130

pauloeduardosp opened this issue Oct 9, 2016 · 8 comments

Comments

@pauloeduardosp
Copy link

Dear,

How can I do a websocket ping? I didn't find any documentation about
Tks

@Links2004
Copy link
Owner

no public API for it yet.

all code is there.
there is only a public function needed that calls:

sendFrame(client, WSop_ping);

incoming ping request is handled here (pong will be send):
https://github.com/Links2004/arduinoWebSockets/blob/master/src/WebSockets.cpp#L433

@pauloeduardosp
Copy link
Author

pauloeduardosp commented Oct 10, 2016

tks for your answer,
I tried put this in code
sendFrame(client, WSop_ping);
but i receive a compilation error

@Links2004
Copy link
Owner

the library need to be adapted.
currently there is no function that can be called in the ino file.

@pauloeduardosp
Copy link
Author

tks for your atention.
i'm not familiarized with biblioteca customization.
I'll try to do in other way,

tks

@Links2004
Copy link
Owner

I can do the change on weekend.

Links2004 added a commit that referenced this issue Oct 22, 2016
@Links2004
Copy link
Owner

version 2.0.5 can send pings now

@pauloeduardosp
Copy link
Author

Tks, could you put an example how to use it?

@Links2004
Copy link
Owner

call

webSocket.sendPing();

to send a ping from Client to Server.
optional you can give a payload, but this is not required.

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

2 participants