谁知道如何初始化socket?(50分)

  • 主题发起人 主题发起人 ForCode
  • 开始时间 开始时间
F

ForCode

Unregistered / Unconfirmed
GUEST, unregistred user!
VC++中的AfxSocketInit
 
WORD wVersionRequested;
WSADATA wsaData;
int err;

wVersionRequested = MAKEWORD( 2, 0 );
err = WSAStartup( wVersionRequested, &wsaData );
if ( err != 0 )
{
/* Tell the user that we could not find a usable */
/* WinSock DLL. */
exit(1);
}
 
uses Socket;

var
wVersionRequested: WORD;
wsaData: WSADATA;
err: Integer;
begin
wVersionRequested: = MAKEWORD( 2, 0 );
err := WSAStartup( wVersionRequested, @wsaData );
end
 
后退
顶部