예제 #1
0
 internal FtpResumeNotSupportedException(FtpResponse ftpResponse)
     : base("Data transfer error: server don't support resuming", ftpResponse)
 {
 }
예제 #2
0
 internal FtpException(string message, FtpResponse ftpResponse)
     : base(message)
 {
     m_ftpResponse	= ftpResponse;
 }
예제 #3
0
 internal FtpServerDownException(FtpResponse ftpResponse)
     : base("FTP service was down.",ftpResponse)
 {
 }
예제 #4
0
 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;
     }
 }
예제 #5
0
 public void RefreshResponse()
 {
     lock(this)
         m_lastResponse = new FtpResponse(m_connection.GetStream());
     foreach(string s in m_lastResponse.Respones)
         m_sessionHost.RaiseResponseEvent(s);
 }
예제 #6
0
        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);
        }