Esempio n. 1
0
 ///<summary>Called when the FtpClient receives a reply on the PASV command from the server.</summary>
 ///<param name="Input">The received reply.</param>
 ///<returns>True if the input has been processed successfully, false otherwise.</returns>
 internal bool ProcessPasvReplyRecv(string Input)
 {
     FtpReply += Input;
     if (FtpClient.IsValidReply(FtpReply))
     {
         ExpectsReply = false;
         ProcessPasvReply(FtpReply);
         FtpReply = "";
         return(true);
     }
     return(false);
 }
Esempio n. 2
0
 ///<summary>Called when we receive a reply from the FTP server that should be ignored.</summary>
 ///<param name="ar">The result of the asynchronous operation.</param>
 private void OnIgnoreReply(IAsyncResult ar)
 {
     try {
         int Ret = DestinationSocket.EndReceive(ar);
         if (Ret <= 0)
         {
             Dispose();
             return;
         }
         FtpReply += Encoding.ASCII.GetString(RemoteBuffer, 0, Ret);
         if (FtpClient.IsValidReply(FtpReply))
         {
             DestinationSocket.BeginReceive(RemoteBuffer, 0, RemoteBuffer.Length, SocketFlags.None, new AsyncCallback(this.OnReplyReceived), DestinationSocket);
             DestinationSocket.BeginSend(Encoding.ASCII.GetBytes(User), 0, User.Length, SocketFlags.None, new AsyncCallback(this.OnCommandSent), DestinationSocket);
         }
         else
         {
             DestinationSocket.BeginReceive(RemoteBuffer, 0, RemoteBuffer.Length, SocketFlags.None, new AsyncCallback(this.OnIgnoreReply), DestinationSocket);
         }
     } catch {
         Dispose();
     }
 }