Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-290

Socket initialization problem Windows 7.

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Critical - P2 Critical - P2
    • None
    • 0.8.1
    • None
    • windows 7, Visual Studio 2010

    Description

      I was trying to build the driver on Windows 7 with scons build utility but I was not able to connect the database with the following lines of code.

      mongo conn[1];
      int status = mongo_client( conn, "127.0.0.1", 27017 );
      if( status != MONGO_OK ) {
      switch ( conn->err )

      { case MONGO_CONN_NO_SOCKET: printf( "no socket\n" ); return 1; case MONGO_CONN_FAIL: printf( "connection failed\n" ); return 1; case MONGO_CONN_NOT_MASTER: printf( "not master\n" ); return 1; }

      }

      I have traced the error receive MONGO_SOCKET_ERROR by tracing conn->err. I have then initialized the socket on env.c file around line# 500 with adding some code. Now it works perfectly fine.

      To build the driver, I have avoided the scons and used a visual studio 2010 project. I am providing the working visual studio project here together with the codes that I have added. I have also used Preprocessor directive MONGO_USE__INT64 and MONGO_ENV_STANDARD.

      Please note that the after compilation the output files will be in Debug folder which are mongo_driver.lib and mongo_driver.dll

      This is also mentionable that the same driver both works fine for OS X 10.6 and Linux 64.

      Attachments

        Activity

          People

            Unassigned Unassigned
            klmahmood Khalid Mahmood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: