/// <summary>The event handler for the 'data received' event.</summary> /// <param name="sender">The connection that originated this event.</param> /// <param name="args">The connection arguments for this event.</param> private void EventHandlerDataReceived(object sender, ConnectionArgs args) { if (DataReceived != null) { DataReceived(sender, args); } }
/// <summary>The event handler for the 'data sent' event.</summary> /// <param name="sender">The connection that originated this event.</param> /// <param name="args">The connection arguments for this event.</param> private void EventHandlerDataSent(object sender, ConnectionArgs args) { if (DataSent != null) { DataSent(sender, args); } }
/// <summary> /// raises our input receive event safely /// </summary> /// <param name="connectionArgs">The connection arg</param> /// <param name="action">The text that was received</param> private void RaiseInputReceived(ConnectionArgs connectionArgs, String action) { if (InputReceived != null) { InputReceived(this, connectionArgs, action); } }
/// <summary>The event handler for the 'client disconnected' event.</summary> /// <param name="sender">The connection that originated this event.</param> /// <param name="args">The connection arguments for this event.</param> private void EventHandlerClientDisconnected(object sender, ConnectionArgs args) { lock (LockObject) { connections.Remove(args.Connection); } ClientDisconnected?.Invoke(this, args); }
/// <summary>The event handler for the 'client disconnected' event.</summary> /// <param name="sender">The connection that originated this event.</param> /// <param name="args">The connection arguments for this event.</param> private void EventHandlerClientDisconnected(object sender, ConnectionArgs args) { lock (LockObject) { connections.Remove(args.Connection); } if (ClientDisconnected != null) { ClientDisconnected(this, args); } }
/// <summary>Raises our input receive event safely.</summary> /// <param name="connectionArgs">The connection arguments</param> /// <param name="action">The text that was received</param> private void RaiseInputReceived(ConnectionArgs connectionArgs, string action) { InputReceived?.Invoke(this, connectionArgs, action); }
/// <summary>The event handler for the 'data sent' event.</summary> /// <param name="sender">The connection that originated this event.</param> /// <param name="args">The connection arguments for this event.</param> private void EventHandlerDataSent(object sender, ConnectionArgs args) { DataSent?.Invoke(sender, args); }
/// <summary>The event handler for the 'data received' event.</summary> /// <param name="sender">The connection that originated this event.</param> /// <param name="args">The connection arguments for this event.</param> private void EventHandlerDataReceived(object sender, ConnectionArgs args) { DataReceived?.Invoke(sender, args); }
/// <summary>This is called when the base server sent data.</summary> /// <param name="sender">The sender of this event.</param> /// <param name="args">The event arguments.</param> private static void BaseServer_OnDataSent(object sender, ConnectionArgs args) { }
/// <summary>This is called when the base server receives data.</summary> /// <param name="sender">The sender of this event.</param> /// <param name="args">The event arguments.</param> private void BaseServer_OnDataReceived(object sender, ConnectionArgs args) { this.ProcessIncomingData(args.Connection, args.Connection.Data); }
/// <summary>This is called when a client disconnects from the base server.</summary> /// <param name="sender">The sender of this event.</param> /// <param name="args">The event arguments.</param> private void BaseServer_OnClientDisconnected(object sender, ConnectionArgs args) { SessionManager.Instance.OnSessionDisconnected(args.Connection); this.UpdateSubSystemHost((ISubSystem)sender, args.Connection.ID + " - Disconnected"); }
/// <summary>This is called when a client connects to the base server.</summary> /// <param name="sender">The sender of this event.</param> /// <param name="args">The event arguments.</param> private void BaseServer_OnClientConnect(object sender, ConnectionArgs args) { // We send the connection to our session manager to deal with. this.UpdateSubSystemHost((ISubSystem)sender, args.Connection.ID + " - Connected"); SessionManager.Instance.OnSessionConnected(args.Connection); }
/// <summary>This is called when we receive input on a connection.</summary> /// <param name="sender">The sender of this event.</param> /// <param name="args">The event arguments.</param> /// <param name="input">The input received.</param> private void CommandServer_OnInputReceived(object sender, ConnectionArgs args, string input) { // We send the data received onto our session manager to deal with the input. SessionManager.Instance.OnInputReceived(args.Connection, input); }