-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onError not called for error return from the server #56
Comments
replace var uri = new Uri("http://localhost:8090");
socket = new SocketIOUnity(uri, new SocketIOOptions
{
Query = new Dictionary<string, string>
{
//{"token", "UNITY" }
}
,
Transport = SocketIOClient.Transport.TransportProtocol.WebSocket
}); add the other callbacks so you know in which phase the socket get disconnected: socket.OnError += (sender, e) => {
Debug.Log("OnError: " + e);
};
socket.OnPing += (sender, e) =>
{
Debug.Print("Ping");
};
socket.OnPong += (sender, e) =>
{
Debug.Print("Pong: " + e.TotalMilliseconds);
};
socket.OnDisconnected += (sender, e) =>
{
Debug.Print("disconnect: " + e);
};
socket.OnReconnectAttempt += (sender, e) =>
{
Debug.Print($"{DateTime.Now} Reconnecting: attempt = {e}");
}; |
I did everything you said, none of the callbacks were called except for the usual ping pong. |
It seems socket.On("exception"...) works. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When emitting the "message" event, I'm throwing an exception on the server on purpose.
I'm expecting OnError to trigger, but it doesn't.
This is the exception packet I captured from the server, which doesn't trigger OnError on the client.
42["exception",{"status":"error","message":"test"}]
The text was updated successfully, but these errors were encountered: