Clearing the command channel

Top  Previous  Next

The CCC (Clear Command Channel) may be used to revert a secure connection back to an un-secure (unencrypted) connection.  This is useful in cases where certain data must be sent unencrypted over the command channel due to NAT routing issues.  To clear the command channel invoke the Ftp.ClearCommandChannel method.  The ClearCommandChannel method may only be used when using an explicit SSL connection and where client is having trouble with PASV connections due to being behind a NAT router.

 

Example

 

// create new Ftp instance

Ftp client = new Ftp(HOST, USER, PWD, PORT);

 

// set connection type to explicit ssl

client.ConnectionType = Ftp.AUTH_TLS;

 

// establish connection securely

client.Connect();

 

// clear command channel

client.ClearCommandChannel();