AnyEvent-FTP

 view release on metacpan or  search on metacpan

lib/AnyEvent/FTP/Client.pm  view on Meta::CPAN

=item $client-E<gt>connect($host, [ $port ])

The host and port of the remote server.  If not specified, the default FTP port will be used (21).

=item $client-E<gt>connect($uri)

The URI of the remote FTP server.  C<$uri> must be either an instance of L<URI> with the C<ftp>
scheme, or a string with an FTP URL.

If you use this method to connect to the FTP server, connect will also attempt to login with
the username and password specified in the URL (or anonymous FTP if no credentials are
specified).

If there is a path included in the URL, then connect will also do a C<CWD> so that you start
in that directory.

=back

=head2 login

 $client->login($user, $pass);

lib/Test/AnyEventFTPServer.pm  view on Meta::CPAN


 my $content = $test_server->content

The last content retrieved from a C<list_ok>, C<nlst_ok> or C<transfer_ok>
test.

=head2 auto_login

 my $bool = $test_server->auto_login

If true (the default) automatically login using the correct credentials.
Normally if you are testing file transfers you want to keep this to the
default value, if you are testing the authentication of a server context
then you want to set this to false.

=head1 METHODS

=head2 create_ftpserver_ok

 my $test_server = create_ftpserver_ok;
 my $test_server = create_ftpserver_ok($default_context);

t/lib/Test2/Tools/ClientTests.pm  view on Meta::CPAN

    host => 'localhost',
    port => 0,
    default_context => 'AnyEvent::FTP::Server::Context::FSRW',
  );

  $config->{host} = 'localhost';
  $config->{user} = join '', map { chr(ord('a') + int rand(26)) } (1..10);
  $config->{pass} = join '', map { chr(ord('a') + int rand(26)) } (1..10);
  {
    my $ctx = context();
    $ctx->note("using fake credentials ", join ':', $config->{user}, $config->{pass});
    $ctx->release;
  }

  $server->on_bind(sub {
    my $port = shift;
    $config->{port} = $port;
    my $ctx = context();
    $ctx->note("binding aeftpd localhost:$port");
    $ctx->release;
  });



( run in 0.248 second using v1.01-cache-2.11-cpan-a5abf4f5562 )