コード例 #1
0
        /// <summary>
        /// Fire the Connected event if it exists.
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnConnected(TcpServerEventArgs e)
        {
            if (Connected != null)
            {
                try
                {
                    Connected(this, e);
                }
                catch (TcpLibException ex)
                {
                    // Close the connection if the application threw an exception that
                    // is caught here by the server.
                    e.ConnectionState.Close();

                    TcpLibApplicationExceptionEventArgs appErr =
                        new TcpLibApplicationExceptionEventArgs(ex);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Fire the Connected event if it exists.
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnConnected(TcpServerEventArgs e)
        {
            if (Connected != null)
            {
                try
                {
                    Connected(this, e);
                }
                catch (TcpLibException ex)
                {
                    // Close the connection if the application threw an exception that
                    // is caught here by the server.
                    e.ConnectionState.Close();

                    TcpLibApplicationExceptionEventArgs appErr =
                        new TcpLibApplicationExceptionEventArgs(ex);

                }
            }
        }
コード例 #3
0
 private void OnRemoteConnected(object sender, TcpServerEventArgs e)
 {
     _client = e.ConnectionState.Connection;
     log.DebugFormat("Client from {0} connected.", _client.RemoteEndPoint.ToString());
 }