the different performance between websocket client and websocket server when remove the network cable. #2889
-
After client connected server, I remove the network cable, and then launch mg_ws_send(connect, nullptr, 0, WEBSOCKET_OP_CLOSE) in client code, of course, client will receive nothing from server, but after a while, client receive MG_EV_CLOSE event. But when I launch mg_ws_send(connect, nullptr, 0, WEBSOCKET_OP_CLOSE) in server code in the same case, it also receive nothing, but the difference with the client is: there is no MG_EV_CLOSE event appear. Does anyone know why? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That will depend on the way the whatever TCP/IP stack you have underneath will work. Mongoose does not have the slightest idea of what a network cable is. as long as you don't close or the socket is not closed, it can't call the close event. |
Beta Was this translation helpful? Give feedback.
That will depend on the way the whatever TCP/IP stack you have underneath will work. Mongoose does not have the slightest idea of what a network cable is. as long as you don't close or the socket is not closed, it can't call the close event.