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 FtpDataSocket(FtpConnectionObject connectionObject) { m_theSocket = OpenSocket(connectionObject); // the data connection type should be set every time it is used connectionObject.DataConnectionType = DataConnectionType.Invalid; }