The INET domain
The main difference is the bind() command … in the UNIX domain, the socket name is a filename, but in the INET domain, the socket name is a machine name and port number:
static struct sockaddr_in serv_adr;
memset( &serv_adr, 0, sizeof(serv_adr) );
serv_adr.sin_family = AF_INET;
serv_adr.sin_addr.s_addr = htonl(INADDR_ANY);
serv_adr.sin_port = htons( 6789 );
Need to open socket with AF_INET instead of AF_UNIX
Also need to include <netdb.h> and <netinet/in.h>