-4
WSADATA wsaData;
SOCKET ConnectSocket = INVALID_SOCKET;
iResult = WSAStartup(MAKEWORD(2,2), &wsaData);

WSADATA is info, but what info is it specifically?

WSAStartup is a function to initiate WS2_32.dll. What is the difference between initiating WS2_32.dll and SOCKET?

MD XF
  • 7,062
  • 7
  • 34
  • 64
  • have you tried google? – Samer May 14 '15 at 17:30
  • 1
    http://stackoverflow.com/a/4993139/1938163 – Marco A. May 14 '15 at 17:30
  • 1
    You can find WSADATA in your header files (you can probably right-click, go to definition) or [on MSDN](https://msdn.microsoft.com/en-us/library/windows/desktop/ms741563.aspx). You need to initialise the library before you can use it to create sockets. – Rup May 14 '15 at 17:30
  • 2
    I'm voting to close this question as off-topic because the post shows no research effort and the poster can't be bothered to read readily available documentation. – Captain Obvlious May 14 '15 at 18:07

1 Answers1

0

WSADATA is info, but what info is it specifically?

Please read the documentation, it tells you exactly what is in WSADATA and what it means:

WSAStartup function

WSADATA structure

WSAStartup is a function to initiate WS2_32.dll.

Correct.

What is the difference between initiating WS2_32.dll and SOCKET?

WS2_32.dll is the WinSock library itself. The SOCKET is a handle to a specific socket connection. The socket is allocated with the socket() or WSASocket() function, and released with the closesocket() function.

Remy Lebeau
  • 454,445
  • 28
  • 366
  • 620