pushed websocket printf improvement

15 views
Skip to first unread message

Basile Starynkevitch

unread,
Nov 21, 2014, 7:03:25 AM11/21/14
to onio...@coralbits.com
Hello All,

In https://github.com/davidmoreno/onion/pull/91/ I am proposing a tiny improvement; adding onion_websocket_vprintf and having onion_websocket_printf use it.
In addition, I am allocating & freeing a temporary buffer if the printf result is larger than 512 bytes.

I am just discovering websockets and I am not familiar with them. Is is conventional practice to use websocket only for asynchronous browser to server messages (without any server to browser communication on the websocket)? My intent is to use AJAX or HTML/HTTP for every browser to server communication.

Then, is there any way to half-shutdown the websocket in onion, e.g. to call shutdown(2) with
SHUT_RD on the websocket (onion server-side), since the onion application would only use the onion_websocket_printf function and will never use onion_websocket_read? Or does that not make any sense or is contrary to WebSocket standard?

Does anyone has a good websocket tutorial or example (above the one in examples/websocket.c file) to recommend?

In my melt-monitor I am considering to add such write-only websockets (where a JSON message is sent on the websocket using onion).

Regards.
--
Basile Starynkevitch          http://starynkevitch.net/Basile/



Basile Starynkevitch

unread,
Dec 9, 2014, 4:58:55 AM12/9/14
to onio...@coralbits.com

I am not at ease with all of git, so I deleted my old onion fork, forked again onion, and am proposing the "same" patch in
https://github.com/davidmoreno/onion/pull/93

I hope that one would be accepted! It only contains one commit

Regards

Basile Starynkevitch    http://starynkevitch.net/Basile/

David Moreno Montero

unread,
Dec 9, 2014, 5:28:47 AM12/9/14
to Basile Starynkevitch, onion-dev
Done!

Thanks!

--
You received this message because you are subscribed to the Google Groups "onion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onion-dev+...@coralbits.com.
To post to this group, send email to onio...@coralbits.com.
Visit this group at http://groups.google.com/a/coralbits.com/group/onion-dev/.
For more options, visit https://groups.google.com/a/coralbits.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages