Exemplo n.º 1
0
        /// <summary>
        /// Maneja el evento <see cref="IListener.Connected"/>.
        /// </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 OnListenerConnected(object sender, ListenerConnectedEventArgs e)
        {
            ServerPeer peer = _serverPeerManager.Connected(e.Channel);

            peer.Disconnected += new PeerDisconnectedEventHandler(OnPeerDisconnected);

            if (Logger.IsDebugEnabled)
            {
                Logger.Debug(string.Format("Server '{0}' - OnListenerConnected '{1}'.",
                                           _name, peer.Name));
            }

            OnConnected(peer);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Traps the <see cref="IListener.Connected"/> event.
 /// </summary>
 /// <param name="sender">
 /// It's the listener sending the event.
 /// </param>
 /// <param name="e">
 /// The event parameters.
 /// </param>
 private void OnListenerConnected(object sender, ListenerConnectedEventArgs e)
 {
     lock ( _syncObject ) {
         _listener.Stop();
     }
 }