warmcat / libwebsockets

canonical libwebsockets.org networking library

Home Page:https://libwebsockets.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: what is a good approach to test a partial read?

samsnori opened this issue · comments

First, thanks for this amazing library! Such a great implementation and API!

I'm implementing a WebSocket Server and wondering what would be a good way to trigger a partial read?

From my understanding only until lws_is_final_fragment() returns 1 the frame is complete and I only want to start processing the data once all data has been received.

Send a large message from the client, in js or whatever. Eg a 1MB message.

It will come in many pieces, you can stash them in order at 'receive' the whole message at once if you must.

Thanks @lws-team !