public void onClientDisconnect(object o, ClientDisconnectEventArgs e) { if (RemoteIP == e.RemoteIP) { MessageBox.Show(ClientName + " has been disconnected from the server"); this.Close(); } }
/// <summary> /// Times the capture. /// </summary> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param> protected void TimeCapture(ClientDisconnectEventArgs e) { var clientDatabaseId = Repository.Client.GetClientDatabaseIdByClientId(e.ClientId); if (clientDatabaseId.HasValue) { Repository.Client.CaptureTime(clientDatabaseId.Value, null, Repository.Static.Now); } }
/// <summary> /// Static method that is invoked when a client is disconnected. /// </summary> static void OnClientDisconnect(ClientDisconnectEventArgs e) { // Remove the client from the list if he's // disconnected from the chat if (PeopleInChat.Contains(e.Client)) { PeopleInChat.Remove(e.Client); } }
/// <summary> /// Invoked when a client is disconnected. /// </summary> private void OnClientDisconnect(ClientDisconnectEventArgs e) { this.Enqueue(() => { if (!Service.IsStopping) { this.Remove(e.Client); } }); }
public frmDisconnected(ClientDisconnectEventArgs e) { InitializeComponent(); //this.instance = instance; //netcom = this.instance.Netcom; AddNetcomEvents(); lblMessage.Text = e.Message; }
public void onClientDisconnect(object o, ClientDisconnectEventArgs e) { for (int i = 0; i < listView3.Items.Count; i++) { if (listView3.Items[i].SubItems[3].Text == e.RemoteIP) { listView3.Items.RemoveAt(i); } } }
/// <summary> /// Handles the ClientDisconnect event of the Notifications control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param> public void Notifications_ClientDisconnect(object sender, ClientDisconnectEventArgs e) { try { ManagerFactory.Invoke(e); } catch (Exception ex) { LogService.Error(ex.ToString()); } }
private void Disconnect() { ClientDisconnectEventArgs e1 = new ClientDisconnectEventArgs(_socket.RemoteEndPoint.ToString()); ClientDisconnectEvent.OnClientDisconnect(e1); settings.ClientsConnected--; Logger.AddLog(new LogInfo("Client disconnected", _socket.RemoteEndPoint.ToString().Split(':')[0])); _socket.Disconnect(false); if (DisconnectHandle != null) { DisconnectHandle(this); } MaxConnections.Disconnect(_socket.RemoteEndPoint); }
public void ClientDisconnected_DisconnectedRaised() { var server = new TestChannelServer <ITestContract>(TntBuilder.UseContract <ITestContract, TestContractMock>()); server.StartListening(); ClientDisconnectEventArgs <ITestContract, TestChannel> disconnectedConnection = null; server.Disconnected += (sender, args) => disconnectedConnection = args; var clientChannel = new TestChannel(); var proxyConnection = TntBuilder.UseContract <ITestContract>().UseChannel(clientChannel).Build(); var pair = server.TestListener.ImmitateAccept(clientChannel); pair.Disconnect(); Assert.IsNotNull(disconnectedConnection, "Disconnect not raised"); }
private void netcom_ClientDisconnected(object sender, ClientDisconnectEventArgs e) { CleanUp(); }
/// <summary> /// 游戏服务器断开事件函数 /// </summary> public void GameServerDisconnected(object sender, ClientDisconnectEventArgs e) { lock (_gameServerList.SyncRoot) { foreach (GameServer server in _gameServerList) { lock (server) { if (server.ConnectionId == e.ConnectionId) { if (server.IsConnected) { server.OnDisconnected(); //return; } } } } } //TODO 需要记录未知的断开 }
/// <summary> /// Determines whether this instance can invoke the specified e. /// </summary> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param> /// <returns> /// <c>true</c> if this instance can invoke the specified e; otherwise, <c>false</c>. /// </returns> public override bool CanInvoke(ClientDisconnectEventArgs e) { return(true); }
/// <summary> /// Invokes the specified e. /// </summary> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param> public virtual void Invoke(ClientDisconnectEventArgs e) { Manager.Where(m => m.CanInvoke(e)).ForEach(m => m.Invoke(e)); }
/// <summary> /// Invokes the specified e. /// </summary> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param> public override void Invoke(ClientDisconnectEventArgs e) { TimeCapture(e); }
public void onClientDisconnect(object o, ClientDisconnectEventArgs e) { Speak("A client has been disconnected"); }
public void client_onClientDisconnect(object o, ClientDisconnectEventArgs e) { Client_Log("Client is disconnected from " + e.RemoteIP + ":" + e.Port.ToString()); }
/// <summary> /// Invokes the specified e. /// </summary> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param> public virtual void Invoke(ClientDisconnectEventArgs e) { }
/// <summary> /// Determines whether this instance can invoke the specified e. /// </summary> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientDisconnectEventArgs"/> instance containing the event data.</param> /// <returns> /// <c>true</c> if this instance can invoke the specified e; otherwise, <c>false</c>. /// </returns> public virtual bool CanInvoke(ClientDisconnectEventArgs e) { return(false); }
private static void Server_OnDisconnect(object sender, ClientDisconnectEventArgs e) { dic.Remove(e.Session.IP); }
private static void ClientLeft_Disconnected(object sender, ClientDisconnectEventArgs e) { ClientLeft(e.ClientId); }