What is the difference between AF_INET and PF_INET in socket programming?

前端 未结 7 850
一向
一向 2020-11-30 16:13

What is the difference between AF_INET and PF_INET in socket programming?

I\'m confused between using AF_INET and PF_INET in socket() and bind()

7条回答
  •  不知归路
    2020-11-30 16:59

    I found in Linux kernel source code that PF_INET and AF_INET are the same. The following code is from file include/linux/socket.h, line 204 of Linux kernel 3.2.21 tree.

    /* Protocol families, same as address families. */
    ...
    #define PF_INET     AF_INET
    

提交回复
热议问题