internal FtpResumeNotSupportedException(FtpResponse ftpResponse) : base("Data transfer error: server don't support resuming", ftpResponse) { }
internal FtpException(string message, FtpResponse ftpResponse) : base(message) { m_ftpResponse = ftpResponse; }
internal FtpServerDownException(FtpResponse ftpResponse) : base("FTP service was down.",ftpResponse) { }
internal void Connect() { m_connection.Connect(m_server, m_port); try { m_lastResponse = new FtpResponse(m_connection.GetStream()); if(m_lastResponse.Code != FtpResponse.ServiceReady) throw new FtpException("Ftp service unavailable.", m_lastResponse); }catch{ Close(); throw; } }
public void RefreshResponse() { lock(this) m_lastResponse = new FtpResponse(m_connection.GetStream()); foreach(string s in m_lastResponse.Respones) m_sessionHost.RaiseResponseEvent(s); }
public void FtpCommand(string cmd) { m_sessionHost.RaiseCommandEvent(cmd); byte[] buff = System.Text.Encoding.Default.GetBytes(cmd + "\r\n"); Stream stream = m_connection.GetStream(); lock(this) { stream.Write(buff, 0, buff.Length); m_lastResponse = new FtpResponse(stream); } foreach(string s in m_lastResponse.Respones) m_sessionHost.RaiseResponseEvent(s); }