title: socket cannot be used as a function
body: <p>Hi I have done Java and C# and recently did a module in C/C++ on the Linux environment. I have decided to make a simple UDP server in C++ in windows which I am new too but not a complete newbie when it comes to coding. I have looked as some examples and it all seems to work apart from this one line:</p>
  
  <pre><code>SOCKET socket = socket(AF_INET, SOCK_DGRAM, 0);
  </code></pre>
  
  <p>when I compile this in Netbeans it comes up with this error message:</p>
  
  <pre><code>classUDPServer.cpp: In constructor 'UDPServer::UDPServer()':
  classUDPServer.cpp:35: error: '((UDPServer*)this)-&gt;UDPServer::socket' cannot be used as a function
      make[2]: *** [build/Debug/MinGW-Windows/classUDPServer.o] Error 1
      make[1]: *** [.build-conf] Error 2
      make: *** [.build-impl] Error 2
  </code></pre>
  
  <p>I have both winsock2.h and iostream included.</p>
  
  <p>Can anyone help me with this error?</p>
  
  <p>Thanks in advance!</p>