in reply to Re: Mojolicious connection to Atlas ssl cluster fails: "Premature connection close"
in thread Mojolicious connection to Atlas ssl cluster fails: "Premature connection close"
givesuse IO::Socket::SSL; my $client = IO::Socket::SSL->new('host_atlas:1024') or die "error=$!, ssl_error=$SSL_ERROR"; print 'done';
>perl test.pl
done%
givesuse Mojo::IOLoop::Client; my $client = Mojo::IOLoop::Client->new; $client->on(connect => sub ($client, $handle) {print "on_connect\n"}); $client->on(error => sub ($client, $err) {print "on_error\n"}); $client->connect({address => 'host_atlas', port => 1024}); $client->reactor->start unless $client->reactor->is_running; print 'done';
>perl test.pl -- Emit connect in Mojo::IOLoop::Client (1) on_connect done%
givesuse feature 'state'; use Mango; use Mojo::IOLoop::Client; my $connect_string=$ARGV[0]; sub mango { state $m = Mango->new($connect_string);} mango->db('mydb')->list_collections(sub { my ($db, $err, $cursor) = @_; print "YESSSSSSSSSSS !!!!\n"; }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
>perl test.pl "$ATLAS_STRING" -- Emit connect in Mojo::IOLoop::Client (1) -- Emit write in Mojo::IOLoop::Stream (0) -- Emit drain in Mojo::IOLoop::Stream (0) -- Emit close in Mojo::IOLoop::Stream (2) -- Emit error in Mojo::Reactor::Poll (1) Mojo::Reactor::Poll: I/O watcher failed: Can't use an undefined value as an ARRAY reference at /var/..../local/lib/perl5/Mango/Cursor.pm line 11. done%
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Mojolicious connection to Atlas ssl cluster fails: "Premature connection close"
by alexander_lunev (Pilgrim) on Mar 03, 2022 at 13:41 UTC | |
by jjmoka (Beadle) on Mar 03, 2022 at 16:26 UTC |