예제 #1
0
 private void Events_ServerDisconnected(object sender, DisconnectionEventArgs e)
 {
     Dispatcher.Invoke(() =>
     {
         txtHistoricoMensagens.Text += $"{e.IpPort} disconectou-se.{Environment.NewLine}";
     });
 }
예제 #2
0
    private static void ClientDisconnected(object sender, DisconnectionEventArgs e)
    {
        Debug.Log($"Client from {e.IpPort} disconnected!");
        Client client = FindClientByIpPort(e.IpPort);

        client.Disconnect();
    }
예제 #3
0
 private void Events_ClientDisconnected(object sender, DisconnectionEventArgs e)
 {
     Dispatcher.Invoke(() =>
     {
         txtHistoricoMensagens.Text += $"{e.IpPort} disconectou-se.{Environment.NewLine}";
         ltbIpsConectados.Items.Remove(e.IpPort);
     });
 }
예제 #4
0
 private void OnDisconnected(object sender, DisconnectionEventArgs e)
 {
     this.BeginInvoke((Action) delegate
     {
         cbo_client.Items.Remove(e.IpPort);
     });
     ShowLog($"客户端断开连接,原因:{e.Reason}");
 }
예제 #5
0
        private void OnClientDisconnected(object sender, DisconnectionEventArgs e)
        {
            Logger.Info($"client '{e.IpPort}' disconnected. Reason: {e.Reason.ToString()} ");

            var removedUser = RemoveClientFromUserList(e.IpPort);

            InformOtherClients(removedUser, e.Reason.ToString());
        }
예제 #6
0
        public void baglantikesildi(object sender, DisconnectionEventArgs args)
        {
            logbox.AppendText("Bağlantı Kesildi: " + args.IpPort + "\r\n");

            foreach (DataGridViewRow row in clientdatagrid.Rows)
            {
                if ((string)row.Cells[0].Value == args.IpPort)
                {
                    int index = row.Index;
                    clientdatagrid.Rows.RemoveAt(index);
                }
            }

            iplist.Remove(args.IpPort); //ip listesinden çıkardık
        }
예제 #7
0
        private static void AsyncSocket_OnSinalizaDesconexao(object sender, DisconnectionEventArgs e)
        {
            Console.WriteLine($"Client {e.SessionID} has disconnected");
            if (e.Exception != null)
            {
                Console.WriteLine($"Reason: {e.Exception.Message}");
            }



            var session = sessions.FirstOrDefault(x => x.SessionID == e.SessionID);

            if (session != null)
            {
                sessions.Remove(session);
            }
        }
예제 #8
0
        public static void disconnectedFromServer(object sender, DisconnectionEventArgs args)
        {
            Tools.writeLog($"Disconnected from server: {args.IpPort}", LogType.Error);

trytoconnect:
            try
            {
                Tools.writeLog("Connecting...", LogType.Info);
                Network.client.Connect();
            }
            catch
            {
                Tools.writeLog($"Server did not respond. Trying to re-connect in {Network.ReconnectSecond} seconds...", LogType.Error);

                Thread.Sleep(Network.ReconnectSecond * 1000); //sleep Network.ReconnectSecond seconds

                goto trytoconnect;
            }
        }
예제 #9
0
        public static void servergitti(object sender, DisconnectionEventArgs args)
        {
            Console.WriteLine("Server Bağlantısı Koptu! Bağlanılmaya Çalışılıyor. Kopma Nedeni: " + args.Reason); //bağlantı kesildi eventi

baglanmayacalis:

            try
            {
                Console.WriteLine("Bağlanılıyor...");

                client.Connect();    //bağlanmaya çalışıyoruz

                Thread.Sleep(10000); //10 sn de bir bağlanmaya çalışıyor
            }
            catch
            {
                Console.WriteLine("Bağlanılamadı.");
                goto baglanmayacalis; //bağlanamayınca geri dönüyoruz
            }
        }
예제 #10
0
        public void CloseSession()
        {
            lock (thisLock)
            {
                ConnectionEvent    -= ConnectionHandler;
                DisconnectionEvent -= DisconnectionHandler;
                MessageEvent       -= MessageHandler;

                this._clients.Remove(this._client);
            }

            // All Clients are informed of the disconnection of this client
            var args = new DisconnectionEventArgs()
            {
                Client = this._client
            };

            DisconnectionEvent?.Invoke(this, args);

            Console.WriteLine("{0} has closed his session", this._client.Name);
        }
예제 #11
0
 private void OnDisconnected(object sender, DisconnectionEventArgs e)
 {
     ShowLog($"断开连接,原因:{e.Reason}");
 }
예제 #12
0
파일: Network.cs 프로젝트: fikret0/Toaster
 public static void ClientBaglantisiKesildi(object sender, DisconnectionEventArgs e)
 {
     Log.Debug("Bağlantı Kesildi: {ip}", e.IpPort);
 }
예제 #13
0
 private void ServerDisconnected(object sender, DisconnectionEventArgs args)
 {
     Logger(Severity.Debug, args.IpPort + " disconnected: " + args.Reason.ToString());
 }
예제 #14
0
 static void ServerClientDisconnected(object sender, DisconnectionEventArgs args)
 {
     Console.WriteLine("Server detected disconnection from client: " + args.IpPort + " [" + args.Reason.ToString() + "]");
 }
예제 #15
0
 private void ServerDisconnected(object sender, DisconnectionEventArgs e)
 {
     Logger.Info($"Client disconnected from server '{Ip}:{Port}'. Reason: '{e.Reason.ToString()}'");
     InvokeServerDisconnectEvent();
 }
예제 #16
0
 private static void ClientServerDisconnected(object sender, DisconnectionEventArgs args)
 {
 }
예제 #17
0
 private void ClientConnectionContainer_ConnectionLost(object sender, DisconnectionEventArgs eventArgs)
 {
 }
예제 #18
0
 private void DisconnectionHandler(object sender, DisconnectionEventArgs e)
 {
     this._callback.DisconnectionClient(e.Client);
 }
예제 #19
0
 private void Events_ClientDisconnected(object sender, DisconnectionEventArgs e)
 {
 }
예제 #20
0
 private static void ServerClientDisconnected(object sender, DisconnectionEventArgs args)
 {
     connectionCount--;
     Console.WriteLine("[server] disconnection from " + args.IpPort + " [now " + connectionCount + "]: " + args.Reason.ToString());
 }
예제 #21
0
 private void OnClientDisconnected(object sender, DisconnectionEventArgs e)
 {
     Logger("Client " + e.IpPort + " disconnected: " + e.Reason.ToString());
     _ClientIpPort = string.Empty;
 }
예제 #22
0
 private static void ServerDisconnected(object sender, DisconnectionEventArgs args)
 {
     Console.WriteLine(args.IpPort + " disconnected: " + args.Reason.ToString());
 }
예제 #23
0
 public static void clientDisconnected(object sender, DisconnectionEventArgs args)
 {
 }