You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, when using serializeJson() in the context of the Web API (to write the JSON into a websocket), we allocate a String, serialize the JSON into that String instance, and then call textAll(String) on the websocket. This creates a copy of the buffer inside AsyncWebsocket.
Describe the solution you'd like
Create an AsyncWebSocketSharedBuffer (std::shared_ptr<std::vector<uint8_t>>) rather than a String and have ArduinoJSON serialize the JSON into that buffer using a custom writer. That will merely create a copy of the std::shared_ptr, but not of the buffer itself.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, when using
serializeJson()
in the context of the Web API (to write the JSON into a websocket), we allocate aString
, serialize the JSON into that String instance, and then calltextAll(String)
on the websocket. This creates a copy of the buffer insideAsyncWebsocket
.Describe the solution you'd like
Create an
AsyncWebSocketSharedBuffer
(std::shared_ptr<std::vector<uint8_t>>
) rather than aString
and have ArduinoJSON serialize the JSON into that buffer using a custom writer. That will merely create a copy of thestd::shared_ptr
, but not of the buffer itself.Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: