当前位置: 技术问答>linux和unix
socket编程 通过man socket, 没有找到socket函数的第一参数该填什么 怎样利用man手册
来源: 互联网 发布时间:2016-08-24
本文导语: 一般第一参数是AF_INET 但我想从手册里得到答案 该学学怎么利用man了 | 这个大概还真没法从man里得到答案。 从函数本身的角度来说,AF_INET只是其中一个可能的值。其他的很多值,比如AF...
一般第一参数是AF_INET 但我想从手册里得到答案 该学学怎么利用man了
|
这个大概还真没法从man里得到答案。
从函数本身的角度来说,AF_INET只是其中一个可能的值。其他的很多值,比如AF_IPX、AF_APPLETALK都是合法的。
如果说“一般第一参数是AF_INET ”,那是因为大多数人写的代码都是用于IP的。
从函数本身的角度来说,AF_INET只是其中一个可能的值。其他的很多值,比如AF_IPX、AF_APPLETALK都是合法的。
如果说“一般第一参数是AF_INET ”,那是因为大多数人写的代码都是用于IP的。
|
$ man socket
......
int socket(int domain, int type, int protocol);
......
The domain argument specifies a communication domain; this selects the protocol
family which will be used for communication. These families are defined in
. The currently understood formats include:
Name Purpose Man page
AF_UNIX, AF_LOCAL Local communication unix(7)
AF_INET IPv4 Internet protocols ip(7)
AF_INET6 IPv6 Internet protocols ipv6(7)
AF_IPX IPX - Novell protocols
AF_NETLINK Kernel user interface device netlink(7)
AF_X25 ITU-T X.25 / ISO-8208 protocol x25(7)
AF_AX25 Amateur radio AX.25 protocol
AF_ATMPVC Access to raw ATM PVCs
AF_APPLETALK Appletalk ddp(7)
AF_PACKET Low level packet interface packet(7)
......
int socket(int domain, int type, int protocol);
......
The domain argument specifies a communication domain; this selects the protocol
family which will be used for communication. These families are defined in
. The currently understood formats include:
Name Purpose Man page
AF_UNIX, AF_LOCAL Local communication unix(7)
AF_INET IPv4 Internet protocols ip(7)
AF_INET6 IPv6 Internet protocols ipv6(7)
AF_IPX IPX - Novell protocols
AF_NETLINK Kernel user interface device netlink(7)
AF_X25 ITU-T X.25 / ISO-8208 protocol x25(7)
AF_AX25 Amateur radio AX.25 protocol
AF_ATMPVC Access to raw ATM PVCs
AF_APPLETALK Appletalk ddp(7)
AF_PACKET Low level packet interface packet(7)
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。