Skip to content

Instantly share code, notes, and snippets.

@RedBeard0531
Created February 19, 2010 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RedBeard0531/309209 to your computer and use it in GitHub Desktop.
Save RedBeard0531/309209 to your computer and use it in GitHub Desktop.
#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