MCO_RET mco_lews_send_websocket_closing_frame(lews_connection_context_h ctx);
ctx
This function sends a WebSocket close control frame to the client, initiating a graceful shutdown of the WebSocket connection as defined in RFC 6455.
After calling this function, the application should stop sending data frames on this connection. The underlying TCP connection may be closed immediately after sending the frame or kept open briefly to receive a close frame from the peer, depending on implementation details.
... // Close the WebSocket connection ret = mco_lews_send_websocket_closing_frame(p_ctx); if (ret != MCO_S_OK) { printf("mco_lews_send_websocket_closing_frame error %d\n", ret); return; } ...
MCO_S_OK
MCO_E_NW_SENDERR