c++ multi-threaded server memory excption

  c++, multithreading, networking, server

I am trying to build multi-threaded server with c++. I made a class that called server.h and the implementation in server.cpp.

when I am running the program I get a wired exception from the constructor of the server class.


    // this server use TCP. that why SOCK_STREAM & IPPROTO_TCP
    // if the server use UDP we will use: SOCK_DGRAM & IPPROTO_UDP
    _serverSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

    if (_serverSocket == INVALID_SOCKET)
        throw std::exception(__FUNCTION__ " - socket");


and this is the exception:


and this is how I declare the class

Server mt_server;

does somebody see any problem?

Source: Windows Questions C++