websocket-sharp icon indicating copy to clipboard operation
websocket-sharp copied to clipboard

#394: added WebSocket.SendTimout to fix issue: https://github.com/sta…

Open 6opuc opened this issue 8 years ago • 2 comments

…/websocket-sharp/issues/394

Problem description: One of our web socket clients for some reason stopped receiving messages(Some bug in our client code). This stopped message delivery to all other clients. After investigating this issue we saw that WebSocketServiceManager.Broadcast() got stuck on delivery to that buggy client for 5+ hours.

Steps to reproduce:

  1. Start WebSocketServer
  2. Connect to WebSocket from client(without Receive)
  3. Start loop with WebSocketServiceManager.Broadcast(/1KB/) with 10000 iterations

Actual result: WebSocketServiceManager.Broadcast() got stuck on 172th iteration

Expected result: Loop should complete successfully

Proposed solution: Add property WebSocket.SendTimeout to limit sending message into socket.

6opuc avatar Aug 16 '17 09:08 6opuc

@sta Can we implement something like this? I'm running into an issue where my Socket.Send is just getting hung and not returning. This is causing my application to just sit there and not continue on. I am 100% sure that the state of the connection is open. Having the ability to put a timeout directly onto the send is the only way I can see our problem getting fixed.

jmalley31 avatar Aug 23 '19 13:08 jmalley31

@sta Hi! I'm wondering if this has been solved because I'm facing similar issues

SaraAkmal avatar Dec 12 '23 20:12 SaraAkmal