首页 > 系统服务 > 详细

linux网络编程头文件

时间:2021-01-04 08:59:54      阅读:21      评论:0      收藏:0      [点我收藏+]
#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;
}

 

linux网络编程头文件

原文:https://www.cnblogs.com/hshy/p/14227611.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!