Hello All,
I have a script that gets data from mongo. Before upgrading mongo to 3.2 and used the old connection method with MongoDB::Connection module, then I have never got the following error:
MongoDB::NetworkTimeout: Timed out while waiting for socket to become ready for reading
I'm using the following connection method:
...
use MongoDB;
my $database_server ="<IP>";
my $database_port = "<port>";
my $username = "<username>";
my $password = "<password>";
my $database_name = "<database>";
my $conn = MongoDB::MongoClient->new(
host => $database_server,
port => $database_port,
db_name => $database_name,
username=> $username,
password => $password,
connectTimeoutMS => -1,
socketTimeoutMS => -1,
);
my $out = $db->get_collection('<collection>')->find(...);
$out->immortal(1);
...
Currently I'm using MongoDB 1.4.0 perl driver and Mongo 3.2.6 server
What am I doing wrong ?
Thanks
Logo
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.