You can change the socket timeout from the connection string. For
example, to set a 5 minute timeout use:
var connectionString = "mongodb://localhost/?sockettimeout=5m"
the default is 30 seconds. You can also change the default for all
servers by setting the SocketTimeout static property of MongoDefaults:
MongoDefaults.SocketTimeout = TimeSpan.FromMinutes(5);
but you would have to make sure to do this BEFORE you call
MongoServer.Create for the first time.
The timeout setting applies to all operations on a server. It is not
currently possible to set a longer timeout for just one individual
operation.
On Feb 9, 8:04 am, Mark Embling <
markembl...@gmail.com> wrote:
> *- which platform are you on? *
> Windows Server 2008 R2. Tried with MongoDB 1.6.5 and 1.7.5 - same issue. The
> application is built with .NET 4.
>
> *- Do you have firewall turn on? *
> Yes, but MongoDB has an exception (and it's connecting to localhost
> anyway...)
>
> *- Do you see anything error from mongod log file? *
> Unfortunately not. That was my first port of call to get any clue as to what
> might be wrong. Looking at that, it's all fine.
>
> *- Are you using sharding/mongos? *