mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
Winsock startup at static init
This commit is contained in:
parent
93b3a2e008
commit
6378b9da4c
@ -105,8 +105,6 @@ namespace mongo {
|
||||
delete response;
|
||||
}
|
||||
};
|
||||
|
||||
static SockAddr unknownAddress( "0.0.0.0", 0 );
|
||||
|
||||
bool assembleResponse( Message &m, DbResponse &dbresponse, const SockAddr &client = unknownAddress );
|
||||
|
||||
|
@ -167,18 +167,23 @@ namespace mongo {
|
||||
}
|
||||
|
||||
void xmain();
|
||||
struct SockStartupTests {
|
||||
SockStartupTests() {
|
||||
|
||||
#if defined(_WIN32)
|
||||
WSADATA d;
|
||||
if ( WSAStartup(MAKEWORD(2,2), &d) != 0 ) {
|
||||
out() << "ERROR: wsastartup failed " << OUTPUT_ERRNO << endl;
|
||||
problem() << "ERROR: wsastartup failed " << OUTPUT_ERRNO << endl;
|
||||
dbexit( EXIT_NTSERVICE_ERROR );
|
||||
namespace {
|
||||
struct WinsockInit {
|
||||
WinsockInit() {
|
||||
WSADATA d;
|
||||
if ( WSAStartup(MAKEWORD(2,2), &d) != 0 ) {
|
||||
out() << "ERROR: wsastartup failed " << OUTPUT_ERRNO << endl;
|
||||
problem() << "ERROR: wsastartup failed " << OUTPUT_ERRNO << endl;
|
||||
dbexit( EXIT_NTSERVICE_ERROR );
|
||||
}
|
||||
}
|
||||
} winsock_init;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
} sstests;
|
||||
|
||||
SockAddr unknownAddress( "0.0.0.0", 0 );
|
||||
|
||||
ListeningSockets* ListeningSockets::_instance = new ListeningSockets();
|
||||
|
||||
|
@ -221,6 +221,8 @@ namespace mongo {
|
||||
struct sockaddr_storage sa;
|
||||
};
|
||||
|
||||
extern SockAddr unknownAddress; // ( "0.0.0.0", 0 )
|
||||
|
||||
const int MaxMTU = 16384;
|
||||
|
||||
inline string getHostName() {
|
||||
|
Loading…
Reference in New Issue
Block a user