/// <summary> /// Initiates use of the Winsock DLL by the current process. /// </summary> /// <param name="requestedVersion"> /// Type: <see cref="yourmt.Sockets.WinSockVersion"/> /// The requested <see cref="WinSockVersion"/>. /// </param> public WsaWrapper(WinSockVersion requestedVersion) { _data = new WsaData(); Int32 res = WinSock2.WSAStartup(requestedVersion, ref _data); if(res != 0) throw new Win32Exception(res); // WSAStartup returns the error value by itself }
public static extern Int32 WSAStartup(WinSockVersion wVersionRequested, ref WsaData wsaData);