Пример #1
0
        /// <summary>
        /// Fires the <see cref="ConnectionRequest"/> event.
        /// </summary>
        private bool OnConnectionRequest(EndPoint remoteEndPoint)
        {
            bool accept = true;

            if (ConnectionRequest != null)
            {
                ListenerConnectionRequestEventArgs eventArgs =
                    new ListenerConnectionRequestEventArgs(remoteEndPoint);

                ConnectionRequest(this, eventArgs);

                accept = eventArgs.Accept;
            }

            return(accept);
        }
Пример #2
0
 /// <summary>
 /// Maneja el evento <see cref="IListener.ConnectionRequest"/>.
 /// </summary>
 /// <param name="sender">
 /// Es el objeto que envía el evento.
 /// </param>
 /// <param name="e">
 /// Son los parámetros del evento.
 /// </param>
 private void OnListenerConnectionRequest(object sender,
                                          ListenerConnectionRequestEventArgs e)
 {
     e.Accept = _serverPeerManager.AcceptConnectionRequest(e.ConnectionInfo);
 }