示例#1
0
        public void Start(TcpClient socket)
        {
            m_theSocket = socket;

            m_theCommands = new FtpConnectionObject(m_fileSystemClassFactory, m_nId, socket);
            m_theThread   = new Thread(ThreadRun);
            m_theThread.Start();
        }
示例#2
0
        public void Start(TcpClient socket)
        {
            m_theSocket = socket;

            m_theCommands = new FtpConnectionObject(m_fileSystemClassFactory, m_nId, socket);
            m_theThread = new Thread(ThreadRun);
            m_theThread.Start();
        }
示例#3
0
        // This command maybe won't work if the ftp server is deployed locally <= firewall
        public PasvCommandHandler(FtpConnectionObject connectionObject, IPEndPoint localPasvEndpoint, IPEndPoint externallyVisiblePasvEndpoint)
            : base("PASV", connectionObject)
        {
            if (externallyVisiblePasvEndpoint == null) throw new ArgumentNullException("localAddress", "The ftp server do not have a ipv4 address");

            // set passive listen port
            this.m_localPasvEndpoint = localPasvEndpoint;
            this.m_externallyVisiblePasvEndpoint = externallyVisiblePasvEndpoint;
        }
示例#4
0
        private static TcpClient OpenSocket(FtpConnectionObject connectionObject)
        {
            TcpClient socketPasv = connectionObject.PasvSocket;

            if (socketPasv != null)
            {
                connectionObject.PasvSocket = null;
                return(socketPasv);
            }

            return(SocketHelpers.CreateTcpClient(connectionObject.PortCommandSocketAddress,
                                                 connectionObject.PortCommandSocketPort));
        }
示例#5
0
        private static TcpClient OpenSocket(FtpConnectionObject connectionObject)
        {
            TcpClient socketPasv = connectionObject.PasvSocket;

            if (socketPasv != null)
            {
                connectionObject.PasvSocket = null;
                return socketPasv;
            }

            return SocketHelpers.CreateTcpClient(connectionObject.PortCommandSocketAddress,
                                                 connectionObject.PortCommandSocketPort);
        }
示例#6
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;
     }
 }
示例#7
0
 public void Start(TcpClient socket, System.Text.Encoding encoding)
 {
     m_theSocket = socket;
     m_lastActiveTime = DateTime.Now;
     m_theCommands = new FtpConnectionObject(
         fileSystemClassFactory: m_fileSystemClassFactory, 
         nId:  m_nId, socket: socket,
         localPasvEndpoint: this.m_localPasvEndpoint,
         externallyVisiblePasvEndpoint: this.m_externallyVisiblePasvEndpoint);
     m_theCommands.Encoding = encoding;
     m_theThread = new Thread(ThreadRun);
     m_theThread.Start();
     m_theMonitorThread = new Thread(ThreadMonitor);
     m_theMonitorThread.Start();
 }
示例#8
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();
        }
示例#9
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();
        }
示例#10
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);
            }
        }
        public void Start(TcpClient socket, System.Text.Encoding encoding)
        {
            m_theSocket = socket;

            m_maxIdleSeconds = StorageProviderConfiguration.MaxIdleSeconds;
            RemoteEndPoint   = m_theSocket.GetRemoteAddrSafelly();

            lock (lastActiveLock)
            {
                m_lastActiveTime = DateTime.UtcNow;
            }

            m_theCommands          = new FtpConnectionObject(m_fileSystemClassFactory, m_nId, socket);
            m_theCommands.Encoding = encoding;

            m_theThread = new Thread(RunSafelly);
            m_theThread.Start();

            m_theMonitorThread = new Thread(MonitorSafelly);
            m_theMonitorThread.Start();
        }
示例#12
0
 public DeleCommandHandler(FtpConnectionObject connectionObject)
     : base("DELE", connectionObject)
 {
 }
示例#13
0
 public TypeCommandHandler(FtpConnectionObject connectionObject)
     : base("TYPE", connectionObject)
 {
 }
示例#14
0
 public FtpReplySocket(FtpConnectionObject connectionObject)
 {
     m_theSocket = OpenSocket(connectionObject);
 }
示例#15
0
 public StouCommandHandler(FtpConnectionObject connectionObject)
     : base("STOU", connectionObject)
 {
 }
 public CDUPCommandHandler(FtpConnectionObject connectionObject)
     : base("CDUP", connectionObject)
 {
 }
示例#17
0
 public PwdCommandHandler(FtpConnectionObject connectionObject)
     : base("PWD", connectionObject)
 {
 }
 protected RemoveDirectoryCommandHandlerBase(string sCommand, FtpConnectionObject connectionObject)
     : base(sCommand, connectionObject)
 {
 }
示例#19
0
 public MdtmCommandHandler(FtpConnectionObject connectionObject)
     : base("MDTM", connectionObject)
 {
 }
示例#20
0
 public RetrCommandHandler(FtpConnectionObject connectionObject)
     : base("RETR", connectionObject)
 {
 }
 public PasvCommandHandler(FtpConnectionObject connectionObject)
     : base("PASV", connectionObject)
 {
 }
示例#22
0
 public HelpCommandHandler(FtpConnectionObject connectionObject)
     : base("HELP", connectionObject)
 {
 }
示例#23
0
 public AppendCommandHandler(FtpConnectionObject connectionObject)
     : base("APPE", connectionObject)
 {
 }
 public RenameCompleteCommandHandler(FtpConnectionObject connectionObject)
     : base("RNTO", connectionObject)
 {
 }
示例#25
0
 public ListCommandHandler(FtpConnectionObject connectionObject)
     : base("LIST", connectionObject)
 {
 }
示例#26
0
 public AlloCommandHandler(FtpConnectionObject connectionObject)
     : base("ALLO", connectionObject)
 {
 }
示例#27
0
 public XCwdCommandHandler(FtpConnectionObject connectionObject)
     : base("XCWD", connectionObject)
 {
 }
示例#28
0
 public SizeCommandHandler(FtpConnectionObject connectionObject)
     : base("SIZE", connectionObject)
 {
 }
示例#29
0
 public ListCommandHandlerBase(string sCommand, FtpConnectionObject connectionObject)
     : base(sCommand, connectionObject)
 {
 }
示例#30
0
 public FtpReplySocket(FtpConnectionObject connectionObject)
 {
     m_theSocket = OpenSocket(connectionObject);
 }
示例#31
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;
 }
示例#32
0
 public NlstCommandHandler(FtpConnectionObject connectionObject)
     : base("NLST", connectionObject)
 {
 }
示例#33
0
 // This command maybe won't work if the ftp server is deployed locally <= firewall
 public PasvCommandHandler(FtpConnectionObject connectionObject)
     : base("PASV", connectionObject)
 {
     // set passive listen port
     m_nPort = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["FTPPASV"].IPEndpoint.Port;
 }
示例#34
0
 public PortCommandHandler(FtpConnectionObject connectionObject)
     : base("PORT", connectionObject)
 {
 }
示例#35
0
 public AlloCommandHandler(FtpConnectionObject connectionObject)
     : base("ALLO", connectionObject)
 {
 }
示例#36
0
 protected MlsxCommandHandlerBase(string sCommand, FtpConnectionObject connectionObject)
     : base(sCommand, connectionObject)
 {
 }
 public QuitCommandHandler(FtpConnectionObject connectionObject)
     : base("QUIT", connectionObject)
 {
 }
示例#38
0
 public UserCommandHandler(FtpConnectionObject connectionObject)
     : base("USER", connectionObject)
 {
 }