/// <summary> /// Event handler for when the base server received data from a connection. /// </summary> /// <param name="sender">Object that triggered the event</param> /// <param name="e">Connection that has incoming data received</param> private void Server_DataReceived(object sender, ConnectionArgs e) { // Process Incoming Data var connection = e.Connection; var data = connection.Data; SessionManager.Instance.OnDataReceived(connection, data); }
private void HandleClientDisconnected(object sender, ConnectionArgs e) { lock (Lock) { connections.Remove(e.Connection); } ClientDisconnected?.Invoke(this, e); }
/// <summary> /// Event handler for when a connection is made on the base server. /// </summary> /// <param name="sender"><see cref="ISubSystem"/> that triggered the event</param> /// <param name="e">Connection that has connected</param> private void Server_ClientConnect(object sender, ConnectionArgs e) { UpdateSubSystemHost((ISubSystem)sender, e.Connection.ID + " - Connected"); SessionManager.Instance.OnSessionConnect(e.Connection); }
/// <summary> /// Event handler for the when the base server has finished sending data to a connection /// </summary> /// <param name="sender">Object that triggered the event</param> /// <param name="e">Connection that the data was sent to</param> private void Server_DataSent(object sender, ConnectionArgs e) { // Do nothing by default. }
private void HandleDataSent(object sender, ConnectionArgs e) { DataSent?.Invoke(sender, e); }
private void HandleDataReceived(object sender, ConnectionArgs e) { DataReceived?.Invoke(sender, e); }