64,654
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <winsock.h>
#define SERVPORT 25001
#define BACKLOG 10
#pragma comment(lib, "WSOCK32.LIB")
void main()
{
int sockfd, client_fd;
struct sockaddr_in my_addr;
struct sockaddr_in remote_addr;
char * msg = "You are Welcome!\n";
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
{
printf("socket创建出错!\n");
exit(1);
}
}
if ((Result=WSAStartup(MAKEWORD(2,2),&wsaData))!=0)
{
printf("WSAStartup failed with error %d\n",Result);
}
添加