/// <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); }
public async Task <FtpResponse> SendCommandAsync(FtpCommandEnvelope envelope, CancellationToken token = default(CancellationToken)) { string commandString = envelope.GetCommandString(); return(await SendCommandAsync(commandString, token)); }