What is AF_INET, and why do I need it?

后端 未结 5 1719
心在旅途
心在旅途 2020-12-12 08:52

I\'m getting started on socket programming, and I keep seeing this AF_INET.

Yet, I\'ve never seen anything else used in its place. My lecturers are not

5条回答
  •  情深已故
    2020-12-12 09:15

    Socket are characterized by their domain, type and transport protocol. Common domains are:

    1. AF_UNIX: address format is UNIX pathname

    2. AF_INET: address format is host and port number

    (there are actually many other options which can be used here for specialized purposes).usually we use AF_INET for socket programming

    Reference: http://www.cs.uic.edu/~troy/fall99/eecs471/sockets.html

提交回复
热议问题