Esempio n. 1
0
 /// <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);
     }
 }
Esempio n. 2
0
 /// <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);
     }
 }
Esempio n. 3
0
 /// <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);
     }
 }
Esempio n. 4
0
        /// <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);
        }
Esempio n. 5
0
        /// <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);
            }
        }
Esempio n. 6
0
 /// <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);
 }
Esempio n. 7
0
 /// <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);
 }
Esempio n. 8
0
 /// <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);
 }
Esempio n. 9
0
 /// <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)
 {
 }
Esempio n. 10
0
 /// <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);
 }
Esempio n. 11
0
        /// <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");
        }
Esempio n. 12
0
 /// <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);
 }
Esempio n. 13
0
 /// <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);
 }