怎么没见过PF_INET,好象只有AF_INET啊?
解决方案 »
- 图像对比--识别两幅相同文字图像的差别
- 建立在一个对话框上的窗口无法响应双击消息
- 关于 MFC框架 中 消息响应 的问题
- 如何获得其他进程的窗口句柄
- 如何在显示器上开一个实时视频显示窗口,以及坐标定位?
- 一个可以很多人同时语音通话的软件,不需要对方IP,不需要登陆
- 我怎么在CHtmlView(WebBrowser2)的页面中查找字符串了?
- 关于CreateFile()函数与驱动程序的问题
- 请问基于文档类的程序中,对话框的变量怎么与另一读写串口线程通信?而不希望用全局变量的形式
- 请问关于UNICODE编码问题,先谢了
- 在vc中如利用ini文件
- ◆◆◆◆ListCtrl控件是不是一定要Report类型,才能用GetItemText,SetItemText?Small Icon不行吗?
#define PF_INET AF_INET|> | AF = address family. These constants go into the sin_family member of the
|> | socket address structure.
|> |
|> | PF = protocol family. These constants are the first argument to socket().
|>
|> There is a little more to it than that. Although I don't have the ancient
|> sources handy to check (and my memory of this particular aspect is fading),
|> I recall that the original socket code (4.1c/2.8/2.9BSD) employed a protocol
|> structure similar in concept to the sockaddr structure. The protocol
|> structure contained a family element and a family-specific protocol number.
|> The PF_ constants were used for the family element of the protocol structure.
|> A protocol structure (or, rather, the address of one) could be passed to the
|> socket() call to serve a purpose similar to that of the last (integer)
|> argument
|> of the current socket() call. (Keep in mind that the old socket() call did
|> not
|> take a family/domain argument at all, so interpretation of the protocol
|> number
|> would not have been possible without the PF_ cue.) Originally, then, the PF_
|> and AF_ constants had a much more parallel purpose as structure tags. When
|> socket() started requiring a family/domain argument, the protocol structure
|> was dropped.
|
| Well, actually your memory is a bit off.
與socket(AF_INET,SOCK_STREAM,0)或socket(AF_INET,SOCK_STREAM,IPPROTO_TCP)有什么區別啊?在程式中用起來好象沒有什么區別呢.
能不能再解釋一下?