[CSHARP-884] Connection and Socket Timeout Created: 02/Jan/14  Updated: 05/Apr/19  Resolved: 02/Jan/14

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.8.3
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: joseph rodriguez Assignee: Unassigned
Resolution: Done Votes: 0
Labels: question
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

What is the default connection and socket timeout when using this C# driver and these options not stated in connection string. Doc says to refer to driver doc, if there is. I coulndt find any mention of a timeout. Also, can you provide the correct syntax of connection string consisting of a replica set that states the connection timeout and socket timeout? Are these timeouts specified in milliseconds?

Thanks



 Comments   
Comment by joseph rodriguez [ 02/Jan/14 ]

Thanks Craig, I'll refer to the forum next time. Didnt really get a clear answer on stack overflow.

Thanks!

Comment by Craig Wilson [ 02/Jan/14 ]

Hi Joseph,
Jira is normally used for feature requests and bugs. We have a users group that can be used for questions here: https://groups.google.com/forum/#!forum/mongodb-user. Also, stackoverflow is a great place for questions.

Now, as far as your questions are concerned. The default socket timeout is whatever the OS's default is. In windows, this value is inifinite. The default connection timeout is 30 seconds. If you'd like to specify them, the documentation is here: http://docs.mongodb.org/manual/reference/connection-string/. An example as your requested is below where we are setting the socket and connection timeouts to 10 seconds each.

mongodb://host1,host2/?connect=replicaset;socketTimeoutMS=10000;connectTimeoutMS=10000

Generated at Wed Feb 07 21:38:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.