internal void EnsureConnected() { if (_stopped) { return; } if (!GameSparksUtil.ShouldConnect) { return; } lock (this) { if (_WebSocketClient == null) { _WebSocketClient = _gSPlatform.GetSocket(url, GSConnection_OnMessageReceived, OnClosed, OnOpened, OnError); } lock (_WebSocketClient) { GameSparksWebSocketState state = _WebSocketClient.State; if (mustConnectBy < DateTime.Now.Ticks && state == GameSparksWebSocketState.Connecting) { Terminate(); } else if (state != GameSparksWebSocketState.Open && state != GameSparksWebSocketState.Connecting) { _WebSocketClient.Open(); } } } }
public void TriggerOnError(string error) { this.State = GameSparksWebSocketState.Closed; if (errorCallback != null) { errorCallback(error); } }
public void TriggerOnOpen() { this.State = GameSparksWebSocketState.Open; if (openCallback != null) { openCallback(); } }
public void TriggerOnError(string message) { State = GameSparksWebSocketState.Closed; if (onError != null) { onError(message); } }
public void TriggerOnOpen() { State = GameSparksWebSocketState.Open; if (onOpen != null) { onOpen(); } }
public void TriggerOnClose() { State = GameSparksWebSocketState.Closed; controller.RemoveWebSocket(this); if (onClose != null) { onClose(); } }
public void TriggerOnClose() { this.State = GameSparksWebSocketState.Closed; this.controller.RemoveWebSocket(this); if (closeCallback != null) { closeCallback(); } }
public void TriggerOnClose() { State = GameSparksWebSocketState.Closed; controller.RemoveWebSocket(this); if (onClose != null) onClose(); }
public void Open() { State = GameSparksWebSocketState.Connecting; GSExternalOpen(SocketId, url, controllerName); }
public void TriggerOnOpen() { this.State = GameSparksWebSocketState.Open; if(openCallback != null) openCallback(); }
public void TriggerOnOpen() { State = GameSparksWebSocketState.Open; if (onOpen != null) onOpen(); }
public void TriggerOnError(string message) { State = GameSparksWebSocketState.Closed; if (onError != null) onError(message); }
public void TriggerOnClose() { this.State = GameSparksWebSocketState.Closed; this.controller.RemoveWebSocket(this); if(closeCallback != null) closeCallback(); }
public void Open() { this.State = GameSparksWebSocketState.Connecting; GSSocketOpen(this.SocketId, url); }
public void Close() { this.State = GameSparksWebSocketState.Closing; GSSocketClose(this.SocketId); }
public void Close() { State = GameSparksWebSocketState.Closing; GSExternalClose(SocketId); }
public void TriggerOnError(string error) { this.State = GameSparksWebSocketState.Closed; if(errorCallback != null) errorCallback(error); }