title: C++ Winsock 10093 error
body: <p>I'm trying to build a server in C++ which can accept multiple number of clients. For that purpose I built a winsock wrapper and using threading with boost for communication for each clients.<br>
  I encountered a strange problem when trying to accept clients, I have a loop that looks like this.</p>
  
  <pre><code>int clientID = 0;
  listenSocket = new Socket(SocketType::TCP);
  listenSocket-&gt;Bind(port);
  listenSocket-&gt;Listen();
  
  while(running)
  {
      Socket *socket = &amp;listenSocket-&gt;Accept();
      mutex.lock();
      clients.push_back(new Client(socket,  clientID));
      mutex.unlock();
  
      std::cout &lt;&lt; "Client with id " &lt;&lt; clientID &lt;&lt; " connected!" &lt;&lt; std::endl;
  
      std::cout &lt;&lt; WSAGetLastError() &lt;&lt; std::endl;
  
      clientID++;
  }
  </code></pre>
  
  <p>Now, the first client accepts fine and the WSAGetLastError() returns 0, but after the first one connected, even if I dont trying to connect another it just keep writing in the console 10093, which means the Accept() in the loop stoppped blocking and for some reason wont accept properly. I read online that this error caused by not calling WSAStartup() but I did called it in the socket's constructor and it did accept in the first time.</p>