linux网络编程头文件

#include <iostream>
using namespace std;
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <malloc.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <stdarg.h>
#include <fcntl.h>
#include <fcntl.h>

typedef struct pollfd FDLIST;
int main()
{
  int fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
	sockaddr_in ladd;
	ladd.sin_family = AF_INET;
	ladd.sin_port = htons(123);
	ladd.sin_addr.s_addr = 0;
	if(bind(fd, (sockaddr*)&ladd, sizeof(ladd)) == 0)
  {
  }
    cout << "Hello, World!" << endl;
    return 0;
}

 

posted on 2021-01-04 00:12  lydstory  阅读(134)  评论(0)    收藏  举报

导航