[CXX-129] Initialize WinSock using mongo initializer Created: 10/Mar/14  Updated: 04/May/14  Resolved: 22/Apr/14

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: legacy-0.8.0

Type: Improvement Priority: Major - P3
Reporter: Eric Milkie Assignee: Mira Carey
Resolution: Done Votes: 0
Labels: legacy-cxx, windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Right now, WSAStartup is called as part of a global object in sock.cpp. This can be subject to odd race conditions since it's hard to control when this happens at runtime.
It should be switched to a MONGO_INITIALIZER so that a driver consumer can control when and if that function is called (as part of mongo::client::init), especially if the C++ driver DLL is dynamically activated at run-time.



 Comments   
Comment by Githook User [ 22/Apr/14 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'hanumantmk@gmail.com'}

Message: Merge pull request #57 from hanumantmk/CXX-129

WSAStartup in an init, cleanup in client::shutdown
Branch: legacy
https://github.com/mongodb/mongo-cxx-driver/commit/7c18d9ebd4d3989aa823efabc2f725683135c387

Comment by Mira Carey [ 22/Apr/14 ]

https://github.com/mongodb/mongo-cxx-driver/pull/57

Comment by Andrew Morrow (Inactive) [ 07/Apr/14 ]

Pulling into legacy-0.8 as we are planning to do a round of windows improvements as part of that release and it would be nice to fix this as part of that effort.

Comment by Eric Milkie [ 10/Mar/14 ]

Also consider calling WSACleanup() as part of client shutdown, after all network operations have ceased.

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