Open sfranzyshen opened 6 years ago
added ... to Socket.cs ...
/// <summary>
/// Reconnects the socket which is disconnected
/// </summary>
/// <param name="socket"></param>
public static void Reconnect(Socket socket) {
SocketManager.Instance.Reconnect(socket, 1);
}
then (in the Connect.cs example) catch event connectError and try again ... using Socket.Reconnect()
socket.On(SystemEvents.connectError , (Exception e) => {
Debug.Log("Socket.io Connection Error: " + e.ToString());
Socket.Reconnect(socket);
});
I have a scenario where the unity socket.io client might get started before the server is ready for connections ... I would like to have the client code repeatedly attempt connection until a connection is made. I'm having problems figuring out how ... this doesn't work
I see changes in the develop branch for disconnect and reconnect ... but when I try and use Socket.Reconnect(socket) I get errors ...