The accept() call waits indefinitely for an incoming connection to arrive, creating a new socket (and stream descriptor newfd) when it does. The structure their_addr gets filled with connection information.

struct sockaddr_vm their_addr;
socklen_t their_addr_len = sizeof their_addr;
if ((newfd = accept(sockfd, (struct sockaddr *) &their_addr, &their_addr_len)) == -1) {
      perror("accept");
      goto close;
}