上传者: tixianmo
|
上传时间: 2022-04-11 20:21:16
|
文件大小: 3KB
|
文件类型: TXT
部分代码
**********Receivefile client.cpp *************/
#include
#include
#pragma comment(lib,"ws2_32.lib")
void main()
{
WSADATA wsaData;
int iResult=WSAStartup(MAKEWORD(2,2),&wsaData);
if (iResult!=NO_ERROR)
printf("Error at WSAStartup()\n");
SOCKET client;
client=socket(AF_INET,SOCKET_STREAM,IPPROTO_TCP);
if(client==INVALID_SOCKET){
printf("Error at socket():%ld\n",WSAGetLastError());
WSACleanup();
return;
}