 <p>You should print the error (using <a href="http://msdn.microsoft.com/en-us/library/ms679360.aspx" rel="nofollow"><code>GetLastError</code></a>). I suspect you are not initializing things:</p> <pre><code>WSADATA wsaData = {0}; WSAStartup(MAKEWORD(2, 2), &amp;wsaData); </code></pre>