[Libwebsockets] How to determine data type received?
ggjunker at gmail.com
Sat Jan 19 02:53:07 CET 2013
It looks like the frame_is_binary member of the wsi struct is not actually
being set anywhere. I put breakpoints in parser.c where it looks like it
should be set in the code (as well as the 04-to-07 upgrade switch
statement, on the text and binary frame cases) and none of those are ever
I know the server is sending it properly because binary data I send to a
browser shows up as an array and not a string. It looks like the client
handling is not doing it properly,
I'll fumble around in the code and see if I can figure out why, but wanted
to post a note on this.
On Thu, Jan 17, 2013 at 6:03 PM, "Andy Green (林安廸)" <andy at warmcat.com>wrote:
> On 18/01/13 07:18, the mail apparently from Gregory Junker included:
>> Is there a way to determine the type of data sent by the remote endpoint
>> in the callback function? For example, if the server sends the client
>> (both using libwebsockets) how can I determine whether "in" points to
>> data sent with LWS_WRITE_BINARY or LWS_WRITE_TEXT (apart from putting
>> that info into my data as well)?
> Hi -
> Good point, until now nothing cared, since everything coming out of the
> can send binary.
> I introduced an api
> int lws_frame_is_binary(struct libwebsocket *wsi)
> so you can find out from the receive callback what the frame type you're
> dealing with is.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libwebsockets