websockets example

Skip to first unread message


Oct 18, 2016, 7:00:37 PM10/18/16
to onion-dev
Hi all,

I like onion alot, cause its very easy to add a webinterface to my embeded projects... Thanks to all who contribute on this project!
Till now i was able to get my Webinterface running based on ajax polling to get the changed data... Thats alot of traffic for not so much data...

So i'm trying to understand how websockets work with onion.

Juggling around with the websocket-example i was able to get the Callback checking for changed Data and send them back through the websocket to the Client.
But then the client have to ask again for new data...
But i as i see now i must have a request for genereating the onion_websocket_new which i need for sending data with onion_websocket_write or onion_websocket_printf.
when i store the websocket var and try to send somthing from outside of the callback function it ends with e segmentation fault...
So i think i miss something fundamental!

I dont ask for working set of code! Just a short description how its meant, so that i can dig deeper on this...

Reply all
Reply to author
0 new messages