-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,860
  • 7
  • 40
  • 71
  • 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
  • `WSADATA` is essentially just a historical vestige from the 1990s at this point. Nothing in it is meaningful or useful any more. But `WSAStartup` still insists on returning it to you. Back in the 90s, some machines had newer versions of Winsock than others, plus you could get Winsock from different vendors. But there has been no new version of Winsock since 2.2 was released in 1996 (yes Microsoft has made lots of changes since, but they stopped incrementing the version number), and third-party (non-Microsoft) implementations have disappeared (ignoring Wine/ReactOS/etc) – Simon Kissane Jan 04 '23 at 22:27

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
  • 555,201
  • 31
  • 458
  • 770