Exemple #1
0
        private void handler_Closed(FtpSocketHandler handler)
        {
            m_apConnections.Remove(handler);

            if (ConnectionClosed != null)
            {
                ConnectionClosed(handler.Id);
            }
        }
Exemple #2
0
        private void Handler_Closed(FtpSocketHandler handler)
        {
            m_apConnections.Remove(handler);

            numberOfConnections = m_apConnections.Count;

            Trace.WriteLine($"Remover a handler, current connection number is {numberOfConnections}", "Information");

            ConnectionClosed?.Invoke(handler.Id);
        }
Exemple #3
0
        private void handler_Closed(FtpSocketHandler handler)
        {
            m_apConnections.Remove(handler);

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

            if (ConnectionClosed != null)
            {
                ConnectionClosed(handler.Id);
            }
        }
Exemple #4
0
        private void handler_Closed(FtpSocketHandler handler)
        {
            m_apConnections.Remove(handler);

            Trace.WriteLine(
                string.Format("Handler closed {0}. Current Count {1}", handler.Socket.Client.RemoteEndPoint.ToString(), m_apConnections.Count),
                "Information");

            if (ConnectionClosed != null)
            {
                ConnectionClosed(handler.Id);
            }
        }
Exemple #5
0
        private void InitialiseSocketHandler(TcpClient socket)
        {
            var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId);

            handler.Start(socket);

            m_apConnections.Add(handler);

            handler.Closed += handler_Closed;

            if (NewConnection != null)
            {
                NewConnection(m_nId);
            }
        }
Exemple #6
0
        private void handler_Closed(FtpSocketHandler handler)
        {
            lock (m_apConnections)
            {
                m_apConnections.Remove(handler);

                LogWrite(
                    $"Client closed: {handler.RemoteEndPoint} current count={m_apConnections.Count}");
                Trace.WriteLine(
                    $"Handler closed {handler.RemoteEndPoint}. Current Count {m_apConnections.Count}",
                    "Information");

                ConnectionClosed?.Invoke(handler.Id);
            }
        }
Exemple #7
0
        private void InitialiseSocketHandler(TcpClient socket)
        {
            var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId);

            handler.UserLoginEvent  += UserLoginEvent;
            handler.UserLogoutEvent += UserLogoutEvent;
            // get encoding for the socket connection
            handler.Start(socket, m_encoding);

            m_apConnections.Add(handler);

            numberOfConnections = m_apConnections.Count;

            Trace.WriteLine($"Add a new handler, current connection number is {numberOfConnections}", "Information");

            handler.Closed += Handler_Closed;

            NewConnection?.Invoke(m_nId);
        }
Exemple #8
0
        private void InitialiseSocketHandler(TcpClient socket)
        {
            var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId);

            // get encoding for the socket connection

            handler.Start(socket, m_encoding);

            m_apConnections.Add(handler);

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

            handler.Closed += handler_Closed;

            if (NewConnection != null)
            {
                NewConnection(m_nId);
            }
        }
Exemple #9
0
        private void InitialiseSocketHandler(TcpClient socket)
        {
            var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId);

            // get encoding for the socket connection

            handler.Start(socket, m_encoding);

            m_apConnections.Add(handler);

            Trace.WriteLine(
                string.Format("Handler created for client {0}. Current Count {1}", socket.Client.RemoteEndPoint.ToString(), m_apConnections.Count),
                "Information");

            handler.Closed += handler_Closed;

            if (NewConnection != null)
            {
                NewConnection(m_nId);
            }
        }
Exemple #10
0
        private void InitialiseSocketHandler(TcpClient socket)
        {
            lock (m_apConnections)
            {
                var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId);
                handler.Closed += handler_Closed;

                // get encoding for the socket connection

                handler.Start(socket, m_encoding);

                m_apConnections.Add(handler);

                FtpServer.LogWrite(
                    $"Client accepted: {socket.Client.RemoteEndPoint} current count={m_apConnections.Count}");
                Trace.WriteLine(
                    $"Handler created for client {handler.RemoteEndPoint}. Current Count {m_apConnections.Count}",
                    "Information");

                NewConnection?.Invoke(m_nId);
            }
        }
Exemple #11
0
        private void InitialiseSocketHandler(TcpClient socket)
        {
            var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId);

            // get encoding for the socket connection

            handler.Start(socket, m_encoding);

            m_apConnections.Add(handler);

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

            handler.Closed += handler_Closed;

            if (NewConnection != null)
            {
                NewConnection(m_nId);
            }
        }
Exemple #12
0
        private void handler_Closed(FtpSocketHandler handler)
        {
            m_apConnections.Remove(handler);

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

            if (ConnectionClosed != null)
            {
                ConnectionClosed(handler.Id);
            }
        }
Exemple #13
0
        private void handler_Closed(FtpSocketHandler handler)
        {
            m_apConnections.Remove(handler);

            if (ConnectionClosed != null)
            {
                ConnectionClosed(handler.Id);
            }
        }
Exemple #14
0
        private void InitialiseSocketHandler(TcpClient socket)
        {
            var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId);
            handler.Start(socket);

            m_apConnections.Add(handler);

            handler.Closed += handler_Closed;

            if (NewConnection != null)
            {
                NewConnection(m_nId);
            }
        }
Exemple #15
0
        private void InitialiseSocketHandler(TcpClient socket)
        {
            var handler = new FtpSocketHandler(
                fileSystemClassFactory: m_fileSystemClassFactory, 
                nId: m_nId, 
                localPasvEndpoint: this.m_localPasvEndpoint, 
                externallyVisiblePasvEndpoint: this.m_externallyVisiblePasvEndpoint,
                maxIdleTime: this.m_maxIdleTime);
            
            // get encoding for the socket connection
            
            handler.Start(socket, m_encoding);

            m_apConnections.Add(handler);

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

            handler.Closed += handler_Closed;

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