This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Ping events propagated to main code socketIO events #18
Labels
enhancement
New feature or request
Comments
Hi @iKK001 Thanks for the good enhancement. I've already implemented / tested OK the changes, with the addition of Will inform when the new release already published. Thanks and Regards, |
Hi @iKK001 The new WebSockets_Generic releases v2.13.0 has just been published. Your contribution is noted in Contributions and Thanks Best Regards, Release v2.13.0
|
Also have a look at the additions in many SIO_related examples, such as: WebSockets_Generic/examples/esp32/ESP32_WebSocketClientSocketIO/ESP32_WebSocketClientSocketIO.ino Lines 94 to 102 in 798f0c4
|
Thank you very much for this quick change and new version. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is your feature request related to a problem? Please describe.
Using SocketIO with your library, I could really use the "ping"/"pong" events in the main code to detect when I am off internet.
One application of this feature-request is to trigger my watchdog timer in my Arduino board. If, for some reason, the internet is off then the Arduino board would get restarted.
Describe the solution you'd like
In order to make the above feature work, all we have to add is the following:
(of course not knowing if you have an even better solution to this - if you do, please let me know....)
Inside
SocketIOclient_Generic.h
file, you can add an event enum (see last line case 7):And inside
SocketIOclient_Generic-Impl.h
file, you can add one line of code to "deviate" the ping to the events-listener in the main code (please not the extra line withrunIOCbEvent(sIOtype_PING, payload, length);
)This allows in the main code:
Additional context
I tried to make a pull-request with this but the appropriate permissions are not available.
Feel free to implement the above solution if you find it helpful for others. Thank you.
The text was updated successfully, but these errors were encountered: