statianzo / Fleck

C# Websocket Implementation
MIT License
2.31k stars 585 forks source link

How to set a timeout #311

Open lvzh opened 3 years ago

lvzh commented 3 years ago

The network is unstable and there are more timeouts. How to set a timeout?I want to set a timeout for sending

AdrianBathurst commented 3 years ago

Timeouts? Websockets don't have timeouts, it's a permanent connection.

lvzh commented 3 years ago

Timeouts? Websockets don't have timeouts, it's a permanent connection.

Can I set a timeout when I send a message? socket.Send(message);

AdrianBathurst commented 3 years ago

Sockets are either connected or not, no timeouts. If it fails to send, then it's not connected. You could check the socket.IsAvailable before send to check it's last know connection state.

lvzh commented 3 years ago

Sockets are either connected or not, no timeouts. If it fails to send, then it's not connected. You could check the socket.IsAvailable before send to check it's last know connection state.

Thank you