Open Radzhab opened 6 years ago
Could you write a test case to demonstrate this issue?
Same problem were... Many people are affect by this issue. Can you fix it please? Error message: "The socket is connected, you needn't connect again!"
Websocket instance properties at the moment of exception:
Test case:
class WebSocketHandler
{
private WebSocket webSocket;
public WebSocketHandler(string ws)
{
webSocket = new WebSocket(ws);
}
public void Initialize()
{
webSocket.Closed += webSocket_Closed;
webSocket.Open();
webSocket.Close();
}
private void webSocket_Closed(object sender, EventArgs e)
{
webSocket.Open();
}
}
Open method just start the open connection procedure. You need wait the OnOpen event to be fired and then make further actions.
@kerryjiang can you provide test case?
@kerryjiang can you provide test sample? I have a similar error "The socket is connecting, cannot connect again"
If WSocket IsNot Nothing AndAlso Not WSocket.State = WebSocketState.Connecting Then WSocket.Open()
++++
@kerryjiang can you provide test sample? I have a similar error "The socket is connecting, cannot connect again"
If WSocket IsNot Nothing AndAlso Not WSocket.State = WebSocketState.Connecting Then WSocket.Open()
do you solve issue?
The typical case is to call Close
, which will perform a close handshake and then close the WebSocket. Forcibly closing a WebSocket without a close handshake should be rare, but if you need to for some reason, call Dispose
on the WebSocket.
Any update on this one?
I connect to server and wanna disconnect from it.
When i rise method
websocket.Close()
its not terminate connection. I see status "Closed". What means it? How force terminate connection?