Example #1
0
        /// <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);
        }
Example #2
0
 private void HandleClientDisconnected(object sender, ConnectionArgs e)
 {
     lock (Lock)
     {
         connections.Remove(e.Connection);
     }
     ClientDisconnected?.Invoke(this, e);
 }
Example #3
0
 /// <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);
 }
Example #4
0
 /// <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.
 }
Example #5
0
 private void HandleDataSent(object sender, ConnectionArgs e)
 {
     DataSent?.Invoke(sender, e);
 }
Example #6
0
 private void HandleDataReceived(object sender, ConnectionArgs e)
 {
     DataReceived?.Invoke(sender, e);
 }