Created
February 19, 2010 21:05
-
-
Save RedBeard0531/309209 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "test.h" | |
#include "mongo.h" | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
int main(){ | |
mongo_connection conn[1]; | |
mongo_connection_options opts; | |
INIT_SOCKETS_FOR_WINDOWS; | |
strncpy(opts.host, TEST_SERVER, 255); | |
opts.host[254] = '\0'; | |
opts.port = 27017; | |
for (int i=0; i< 100000; i++){ | |
if (mongo_connect( conn , &opts )){ | |
printf("failed to connect\n"); | |
exit(1); | |
} | |
mongo_destroy( conn ); | |
printf("%d\n", i); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment