arm中socket函数在哪个头文件中申明?并且af_inet,socker_streamm.0两个函数有什么区别

arm中socket函数在哪个头文件中申明?并且af_inet,socker_streamm.0两个函数有什么区别,第1张

1、socket函数声明在sys/socket.h中

2、AF_INET、SOCK_STREAM 是2个整型参数,其中:

AF_INET:IPV4 internet协议

SOCK_STREAM:面向连接的全双工字节流通信

addr属于:

#include<netdb.h>

struct addrinfo

{

int ai_flags

int ai_family//AF_INET,AF_INET6,UNIX etc

int ai_socktype//STREAM,DATAGRAM,RAW

int ai_protocol//IPPROTO_IP, IPPROTO_IPV4, IPPROTO_IPV6 etc

size_t ai_addrlen//length of ai_addr

char* ai_canonname//full hostname

struct sockaddr* ai_addr//addr of host

struct addrinfo* ai_next

}

value of ai_falgs:

AI_PASSIVE: Socket address is intended for `bind'.

AI_CANONNAME:Request for canonical name.

AI_NUMERICHOST: Don't use name resolution.

AI_V4MAPPED: IPv4 mapped addresses are acceptable.

AI_ALL: Return IPv4 mapped and IPv6 addresses.

AI_ADDRCONFIG:Use configuration of this host to choose


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/11624146.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-17
下一篇 2023-05-17

发表评论

登录后才能评论

评论列表(0条)

保存