in reply to problem with UNIX Domain sockets
For streams, use SOCK_STREAM and accept(). (See TCP server in Cookbook.)
For datagrams, use SOCK_DGRAM and recv(). (See UDP server in Cookbook.)
You are mixing SOCK_DGRAM and accept().