Inheritance: IWebSocketClosedEventArgs
 protected virtual void OnClosed(object sender, WebSocketClosedEventArgs args)
 {
     if (this.Closed != null)
     {
         Closed(sender, EventArgs.Empty);
     }
 }
Esempio n. 2
0
 private void WebSocket_Closed(Windows.Networking.Sockets.IWebSocket sender, Windows.Networking.Sockets.WebSocketClosedEventArgs args)
 {
     Debug.Log("WebSocket_Closed; Code: " + args.Code + ", Reason: \"" + args.Reason + "\"");
     // Add additional code here to handle the WebSocket being closed.
     if (this.messageWebSocket == sender)
     {
         CloseSocket();
     }
     socketConnected = false;
 }
Esempio n. 3
0
        private void Closed(IWebSocket sender, WebSocketClosedEventArgs args)
        {
            System.Diagnostics.Debug.WriteLine("Closed; Code: " + args.Code + ", Reason: " + args.Reason);

            if (messageWebSocket != null)
            {
                messageWebSocket.Dispose();
                messageWebSocket = null;
            }
        }
Esempio n. 4
0
        void OnWebSocketClosed(IWebSocket sender, WebSocketClosedEventArgs args)
        {
            if (this.webSocket != null)
            {
                this.webSocket.Dispose();
            }

            Connection temp = this.connection;
            if (temp != null)
            {
                temp.OnIoException(new ObjectDisposedException(string.Format("WebSocket closed. code={0} reason={1}", args.Code, args.Reason)));
            }
        }
 private void OnClosed(IWebSocket sender, WebSocketClosedEventArgs args)
 {
     Dispose();
 }
 private void WebSocket_Closed(Windows.Networking.Sockets.IWebSocket sender, Windows.Networking.Sockets.WebSocketClosedEventArgs args)
 {
     UnityEngine.Debug.Log("WebSocket_Closed; Code: " + args.Code + ", Reason: \"" + args.Reason + "\"");
     CoreApplication.Exit();
 }
Esempio n. 7
0
        // This may be triggered remotely by the server or locally by Close/Dispose()
        private async void OnClosed(IWebSocket sender, WebSocketClosedEventArgs args)
        {
            // Dispatch the event to the UI thread so we do not need to synchronize access to messageWebSocket.
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                AppendOutputLine("Closed; Code: " + args.Code + ", Reason: " + args.Reason);

                if (messageWebSocket == sender)
                {
                    CloseSocket();
                    UpdateVisualState();
                }
            });
        }
Esempio n. 8
0
 private void Mws_Closed(IWebSocket sender, WebSocketClosedEventArgs args)
 {
     if (mws != null)
     {
         mws.Dispose();
         mws = null;
     }
     //NotifyUser("Disconnected", NotifyType.StatusMessage);
     //connectButton.Content = "Connect";
 }
Esempio n. 9
0
 private void Connection_Closed(IWebSocket sender, WebSocketClosedEventArgs args)
 {
     MessageWebSocket webSocket = Interlocked.Exchange(ref _connection, null);
     webSocket?.Dispose();
 }
Esempio n. 10
0
        void mws_Closed(IWebSocket sender, WebSocketClosedEventArgs args)
        {
            MessageWebSocket websocket = Interlocked.Exchange(ref mws, null);
            if (websocket != null)
            {
                websocket.Dispose();
            }
            //if(this.mwsState == WebSocketState.Closing)
                this.OnSocketConnectionClosedEvent(this, EventArgs.Empty);
            this.mwsState = WebSocketState.Closed;

        }
 private void OnClosed(int id, IWebSocket webSocket, WebSocketClosedEventArgs args)
 {
     SendEvent("websocketClosed", new JObject
     {
         { "id", id },
         { "code", args.Code },
         { "reason", args.Reason },
     });
 }
Esempio n. 12
0
        private void WebsocketClosed(IWebSocket webSocket, WebSocketClosedEventArgs eventArgs)
        {
            _connection.Trace(TraceLevels.Events, "WS: WebsocketClosed - Code: {0}, Reason {1}", eventArgs.Code, eventArgs.Reason);

            DisposeSocket();

            if (AbortHandler.TryCompleteAbort() || _disconnectToken.IsCancellationRequested)
            {
                return;
            }

            Task.Run(() => Reconnect(_connection, _connectionData));
        }
 void _socket_Closed(IWebSocket sender, WebSocketClosedEventArgs args)
 {
     this.OnClosed(sender, args);
 }
Esempio n. 14
0
 private void OnClosed(IWebSocket sender, WebSocketClosedEventArgs args)
 {
     Debug.WriteLine("WebsocketTask disconnected...");
     var t = args;
     // TODO return
     _deferral.Complete();
 }
 private void Message_Closed(IWebSocket sender, WebSocketClosedEventArgs args)
 {
 }
        private void Closed(IWebSocket sender, WebSocketClosedEventArgs args)
        {
            // You can add code to log or display the code and reason
            // for the closure (stored in args.Code and args.Reason)

            // This is invoked on another thread so use Interlocked 
            // to avoid races with the Start/Close/Reset methods.
            if (webSocket != null)
            {
                MessageWebSocket ws = Interlocked.Exchange(ref webSocket, null);
                if (ws != null)
                {
                    ws.Dispose();
                }
            }
        }
 void _websocket_Closed(IWebSocket sender, WebSocketClosedEventArgs args)
 {
     IsOpen = false;
     OnClosed();
 }
 private void Sck_Closed(IWebSocket sender, WebSocketClosedEventArgs args)
 {
     state = WebSocketState.CLOSED;
     com.codename1.io.websocket.WebSocket.closeReceived(id, args.Code, args.Reason);
     closeSocket();
 }
Esempio n. 19
0
 private void OnCloseReceived(IWebSocket sender, WebSocketClosedEventArgs args)
 {
     var recvResult = new WebSocketReceiveResult(0, WebSocketMessageType.Close, true, (WebSocketCloseStatus)args.Code,
         args.Reason);
     _closeWebSocketReceiveResultTcs.TrySetResult(recvResult);
 }
Esempio n. 20
0
 private void WebSocket_Closed(Windows.Networking.Sockets.IWebSocket sender, Windows.Networking.Sockets.WebSocketClosedEventArgs args)
 {
     Debug.Log($"Closing WebSocket: Code: {args.Code}, Reason: {args.Reason}");
     // Add additional code here to handle the WebSocket being closed.
 }
Esempio n. 21
0
 // Close connection
 private void Closed(IWebSocket sender, WebSocketClosedEventArgs args)
 {
     MessageWebSocket webSocket = Interlocked.Exchange(ref messageWebSocket, null);
     if (webSocket != null)
     {
         webSocket.Dispose();
     }
 }
 private void WebSocketClient_Closed(IWebSocket sender, WebSocketClosedEventArgs args)
 {
     if (this.m_OnWebSocketClosed != null)
         this.m_OnWebSocketClosed((object) this, new WebSoceketCloseEventArgs());
     this.connected = false;
     this.status = SocketStatus.SocketDisconnected;
 }
        // This may be triggered remotely by the server or locally by Close/Dispose()
        private void Closed(IWebSocket sender, WebSocketClosedEventArgs args)
        {
            MarshalText(OutputField, "Closed; Code: " + args.Code + ", Reason: " + args.Reason + "\r\n");

            if (messageWebSocket != null)
            {
                messageWebSocket.Dispose();
                messageWebSocket = null;
            }
        }
        void Closed(IWebSocket sender, WebSocketClosedEventArgs args)
        {
            // You can add code to log or display the code and reason
            // for the closure (stored in args.Code and args.Reason)

            // This is invoked on another thread so use Interlocked 
            // to avoid races with the Start/Close/Reset methods.
            var webSocket = Interlocked.Exchange(ref streamWebSocket, null);
            if (webSocket != null)
            {
                webSocket.Dispose();
            }

            var ev = _onClosed;

            if (ev != null)
            {
                ev();
            }

            streamWebSocket = null;
        }
        /*public void shutdown()
        {
            stop.set(true);
        }
    }*/

        private void OnClosed(IWebSocket sender, WebSocketClosedEventArgs args)
        {
            Debug.WriteLine("WSC disconnected...");
        }
Esempio n. 26
0
 private void WebSocket_Closed(Windows.Networking.Sockets.IWebSocket sender, Windows.Networking.Sockets.WebSocketClosedEventArgs args)
 {
     m_Error = "Closed";
     FlowNetworkManager.log("WebSocket_Closed; Code: " + args.Code + ", Reason: \"" + args.Reason + "\"");
     // Add additional code here to handle the WebSocket being closed.
 }