Most non-transfer operations are instant. If non-transfer operation is taking so long that it has to be canceled, it usually means that the connection is already broken or some error occurred at server. In such situations, it's recommended to dispose the Sftp/Ftp object and connect & login again.