Ejemplo n.º 1
0
        public void Start(TcpClient socket, System.Text.Encoding encoding)
        {
            m_theSocket = socket;

            m_maxIdleSeconds = StorageProviderConfiguration.MaxIdleSeconds;

            m_lastActiveTime = DateTime.Now;

            m_theCommands          = new FtpConnectionObject(m_fileSystemClassFactory, m_nId, socket);
            m_theCommands.Encoding = encoding;
            m_theThread            = new Thread(ThreadRun);
            m_theThread.Start();
            m_theMonitorThread = new Thread(ThreadMonitor);
            m_theMonitorThread.Start();
        }
Ejemplo n.º 2
0
        private static TcpClient OpenSocket(FtpConnectionObject connectionObject)
        {
            switch (connectionObject.DataConnectionType)
            {
            case DataConnectionType.Active:
                return(SocketHelpers.CreateTcpClient(connectionObject.PortCommandSocketAddress,
                                                     connectionObject.PortCommandSocketPort));

            case DataConnectionType.Passive:
                return(connectionObject.PassiveSocket);

            default:
                FtpServerMessageHandler.SendMessage(connectionObject.Id, "Invalid connection type!");
                return(null);
            }
        }
Ejemplo n.º 3
0
 public FtpDataSocket(FtpConnectionObject connectionObject)
 {
     m_theSocket = OpenSocket(connectionObject);
     // the data connection type should be set every time it is used
     connectionObject.DataConnectionType = DataConnectionType.Invalid;
 }