Beispiel #1
0
 private void RaiseConnectionPointConnected(ServerConnectionPoint connectionPoint)
 {
     if (ConnectionPointConnected != null)
     {
         ConnectionPointConnected(this, new ServerConnectionPointEventArgs(connectionPoint));
     }
 }
Beispiel #2
0
        /// <summary>
        /// принимает входящие соединения
        /// (поток B)
        /// </summary>
        /// <param name="parameter"></param>
        private void Accept(object parameter)
        {
            try
            {
                log.InfoFormat("[{0}] начало приема входящих точек соединения на порту {1}", this, port);
                while (true)
                {
                    var clientSocket = acceptSocket.Accept();

                    var remoteEndPoint = clientSocket.RemoteEndPoint as IPEndPoint;
                    if (remoteEndPoint != null)
                    {
                        log.InfoFormat("[{0}] принято подключение от {1}", this, remoteEndPoint.Address);
                    }

                    var serverConnectionPoint = new ServerConnectionPoint(clientSocket, "PROXY");
                    RaiseConnectionPointConnected(serverConnectionPoint);
                }
            }
            catch (Exception)
            {
            }
        }
Beispiel #3
0
 public ServerConnectionPointEventArgs(ServerConnectionPoint connectionPoint)
 {
     ConnectionPoint = connectionPoint;
 }