Let s
be a file descriptor of a socket made by socket(PF_INET, ...)
.
If I call accept(s, (struct sockaddr *) &addr, ...)
, where addr
is of type struct sockaddr_in
, can I assume that the format of the returned address is IPv4, i.e.,
addr.sin_family == AF_INET
?
From The Open Group's description:
The
accept()
function shall extract the first connection on the queue of pending connections, create a new socket with the same socket type protocol and address family as the specified socket, and allocate a new file descriptor for that socket.