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(); }
// 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; }
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)); }
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); }
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_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(); }
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(); }
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(); }
public DeleCommandHandler(FtpConnectionObject connectionObject) : base("DELE", connectionObject) { }
public TypeCommandHandler(FtpConnectionObject connectionObject) : base("TYPE", connectionObject) { }
public FtpReplySocket(FtpConnectionObject connectionObject) { m_theSocket = OpenSocket(connectionObject); }
public StouCommandHandler(FtpConnectionObject connectionObject) : base("STOU", connectionObject) { }
public CDUPCommandHandler(FtpConnectionObject connectionObject) : base("CDUP", connectionObject) { }
public PwdCommandHandler(FtpConnectionObject connectionObject) : base("PWD", connectionObject) { }
protected RemoveDirectoryCommandHandlerBase(string sCommand, FtpConnectionObject connectionObject) : base(sCommand, connectionObject) { }
public MdtmCommandHandler(FtpConnectionObject connectionObject) : base("MDTM", connectionObject) { }
public RetrCommandHandler(FtpConnectionObject connectionObject) : base("RETR", connectionObject) { }
public PasvCommandHandler(FtpConnectionObject connectionObject) : base("PASV", connectionObject) { }
public HelpCommandHandler(FtpConnectionObject connectionObject) : base("HELP", connectionObject) { }
public AppendCommandHandler(FtpConnectionObject connectionObject) : base("APPE", connectionObject) { }
public RenameCompleteCommandHandler(FtpConnectionObject connectionObject) : base("RNTO", connectionObject) { }
public ListCommandHandler(FtpConnectionObject connectionObject) : base("LIST", connectionObject) { }
public AlloCommandHandler(FtpConnectionObject connectionObject) : base("ALLO", connectionObject) { }
public XCwdCommandHandler(FtpConnectionObject connectionObject) : base("XCWD", connectionObject) { }
public SizeCommandHandler(FtpConnectionObject connectionObject) : base("SIZE", connectionObject) { }
public ListCommandHandlerBase(string sCommand, FtpConnectionObject connectionObject) : base(sCommand, connectionObject) { }
public FtpDataSocket(FtpConnectionObject connectionObject) { m_theSocket = OpenSocket(connectionObject); // the data connection type should be set every time it is used connectionObject.DataConnectionType = DataConnectionType.Invalid; }
public NlstCommandHandler(FtpConnectionObject connectionObject) : base("NLST", connectionObject) { }
// 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; }
public PortCommandHandler(FtpConnectionObject connectionObject) : base("PORT", connectionObject) { }
protected MlsxCommandHandlerBase(string sCommand, FtpConnectionObject connectionObject) : base(sCommand, connectionObject) { }
public QuitCommandHandler(FtpConnectionObject connectionObject) : base("QUIT", connectionObject) { }
public UserCommandHandler(FtpConnectionObject connectionObject) : base("USER", connectionObject) { }