服务端程序
#include <Winsock2.h>
#include <stdio.h>
#pragma comment(lib,"Ws2_32.lib")
void main()
{
///////////配置了socket的版本信息
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested = MAKEWORD( 1, 1 );
////0 成功
err = WSAStartup( wVersionRequested, &wsaData );
if ( err != 0 ) {
return;
}
if ( LOBYTE( wsaData.wVersion ) != 1 ||
HIBYTE( wsaData.wVersion ) != 1 ) {
WSACleanup( );
return;
}
//////