示例#1
0
        /// <summary>
        /// Sends a command to the FTP server, and returns the response
        /// </summary>
        /// <param name="envelope"></param>
        /// <returns></returns>
        public async Task <FtpResponse> SendCommandAsync(FtpCommandEnvelope envelope)
        {
            string commandString = envelope.GetCommandString();

            Logger?.LogDebug($"[FtpClient] Sending command: {commandString}");
            commandSocket.Send(commandString.ToAsciiBytes());

            var response = await GetResponseAsync();

            return(response);
        }
示例#2
0
 public async Task <FtpResponse> SendCommandAsync(FtpCommandEnvelope envelope, CancellationToken token = default(CancellationToken))
 {
     return(await ControlStream.SendCommandAsync(envelope, token));
 }
示例#3
0
        public async Task <FtpResponse> SendCommandAsync(FtpCommandEnvelope envelope, CancellationToken token = default(CancellationToken))
        {
            string commandString = envelope.GetCommandString();

            return(await SendCommandAsync(commandString, token));
        }