Is there anything to do after ‘mg_ws_send(conn, NULL, 0, WEBSOCKET_OP_CLOSE)’? #3017
-
HI I need to replace the I changed this code to the following mg_ws_send(conn, response.c_str(), response.length(), WEBSOCKET_OP_TEXT); Receive an error message on the client side after the change. What could be the problem? WebSocket connection to ' ' failed: Close received after close |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Please see our documentation, and follow the guidelines in our tutorials.
https://www.rfc-editor.org/rfc/rfc6455#section-5.6 https://www.rfc-editor.org/rfc/rfc6455#section-5.5.1 You are sending a CLOSE. It will CLOSE as you requested. |
Beta Was this translation helpful? Give feedback.
Please see our documentation, and follow the guidelines in our tutorials.
https://mongoose.ws/documentation/#websocket
https://mongoose.ws/documentation/#mg_ws_send
Do not think in terms of "replacing this call with that call"; think in terms of "doing this with this new tool"
https://www.rfc-editor.org/rfc/rfc6455#section-5.6
https://www.rfc-editor.org/rfc/rfc6455#section-5.5.1
You are sending a CLOSE. It will CLOSE as you requested.