IXWebSocket icon indicating copy to clipboard operation
IXWebSocket copied to clipboard

Result sending data OK even the client was not connected

Open Igi54 opened this issue 2 years ago • 1 comments

Hello, thank you for this very good library. But I have an issue. I have server and several clients. A client is connected. After a minute I disconnect the client by turning off power supply (so the client cannot send close). Now I send a data from server to the client which was disconnected. But I the result of the sending data is OK. But it could not been sent because physically the client is not connected anymore. How to please fix it? Thank you in advance.

Igi54 avatar Apr 26 '23 15:04 Igi54

You can't really trust the websocket 'send' return value, it just tells you if there were some big errors, but the packets could be lost while bouncing around, hoping from one distant network switch to another.

To be really sure you need to send back ack. There are a lot of chat protocols that implement this (jabber is one).

bsergean avatar May 01 '23 04:05 bsergean