title: C++ term does not evaluate to a function taking 0 arguments thread sockets
body: <p>Recently, I've been trying to make a socket server that accepts multiple clients. I am using basic threads (and I don't want to use the boost library). But I get the error <code>'term does not evaluate to a function taking 0 arguments thread sockets'</code> everytime, and it is because of the threading. If I comment the threading, it does work.</p>
  
  <p>Anybody who can help me with that?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>#include &lt;WinSock2.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;thread&gt;
  
  #define BUFFER_SIZE 1024
  
  class TcpClient {
  private:
      SOCKET s;
      SOCKADDR_IN a;
      std::thread t;
  public:
      TcpClient(SOCKADDR_IN addr, SOCKET client) {
          this-&gt;s = client;
          this-&gt;a = addr;
  
          this-&gt;t = std::thread(&amp;TcpClient::receiving_func);
          this-&gt;t.join();
      }
  
      void receiving_func(void* v) {
          for (;;) {
              char* data = new char[BUFFER_SIZE];
              int bytes = recv(this-&gt;s, data, BUFFER_SIZE, 0);
              std::string raw = std::string(data);
              raw = raw.substr(0, bytes);
              printf_s("Received %s\n", raw);
          }
      }
  };
  </code></pre>