Exemplo n.º 1
0
        private void handler_Closed(FtpSocketHandler handler)
        {
            m_apConnections.Remove(handler);

            Console.WriteLine(
                "Information: Remover a handler, current connection number is {0}",
                m_apConnections.Count);

            if (ConnectionClosed != null)
            {
                ConnectionClosed(handler.Id);
            }
        }
Exemplo n.º 2
0
        private void InitialiseSocketHandler(TcpClient socket)
        {
            var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId, config);

            // get encoding for the socket connection

            handler.Start(socket, m_encoding);

            m_apConnections.Add(handler);

            Console.WriteLine(
                "Information: Add a new handler, current connection number is {0}",
                m_apConnections.Count);

            handler.Closed += handler_Closed;

            if (NewConnection != null)
            {
                NewConnection(m_nId);
            }
        }