You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I was testing the code from the sample I intentionally added a wrong URL but instead of OnError it triggers OnClose, is this the normal behavior or is something wrong
`
public class NotiSocket
{
private WebSocketSharp.WebSocket m_webSocket;
public NotiSocket()
{
m_webSocket = new WebSocketSharp.WebSocket("ws:///notisocket/noti");
m_webSocket.OnMessage += m_webSocket_OnMessage;
m_webSocket.OnError += m_webSocket_OnError;
m_webSocket.OnOpen += m_webSocket_OnOpen;
m_webSocket.OnClose += m_webSocket_OnClose;
m_webSocket.Connect();
Console.ReadLine();
}
private void m_webSocket_OnClose(object sender, WebSocketSharp.CloseEventArgs e)
{
Console.WriteLine("Disconnected to websocket server.");
}
//error on websocket
private void m_webSocket_OnError(object sender, WebSocketSharp.ErrorEventArgs e)
{
Console.WriteLine(e.Message);
}
//connected to websocket server
private void m_webSocket_OnOpen(object sender, EventArgs e)
{
Console.WriteLine("Connected to websocket server");
//m_webSocket.Send("Hello");
}
//receive msg from websocket server
private void m_webSocket_OnMessage(object sender, WebSocketSharp.MessageEventArgs e)
{
Console.WriteLine(e.Data);
}
}
`
The text was updated successfully, but these errors were encountered:
When I was testing the code from the sample I intentionally added a wrong URL but instead of OnError it triggers OnClose, is this the normal behavior or is something wrong
`
public class NotiSocket
{
private WebSocketSharp.WebSocket m_webSocket;
public NotiSocket()
{
m_webSocket = new WebSocketSharp.WebSocket("ws:///notisocket/noti");
m_webSocket.OnMessage += m_webSocket_OnMessage;
m_webSocket.OnError += m_webSocket_OnError;
m_webSocket.OnOpen += m_webSocket_OnOpen;
m_webSocket.OnClose += m_webSocket_OnClose;
m_webSocket.Connect();
Console.ReadLine();
}
}
`
The text was updated successfully, but these errors were encountered: