Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!ukc!stl!pau From: pau@stl.stc.co.uk (Vipin Pau) Newsgroups: comp.unix.questions Subject: DATAGRAM sockets in the UNIX DOMAIN. Message-ID: <577@acer.stl.stc.co.uk> Date: Wed, 9-Sep-87 13:58:35 EDT Article-I.D.: acer.577 Posted: Wed Sep 9 13:58:35 1987 Date-Received: Sat, 12-Sep-87 04:42:12 EDT Reply-To: pau@stl.UUCP (Vipin Pau) Organization: STL,Harlow,UK. Lines: 57 Help needed with INTERRUPTS when used with DATAGRAM sockets in the UNIX domain. At the moment we have a simple CLIENT/SERVER model where the communication is done using DATAGRAM sockets in the INET domain with INTERRUPTS which works successfully. The same exercise in the UNIX domain has not been sucessful. A skeleton code is supplied to clarify (hopefully) /* SERVER */ struct sockaddr_un sock; fd=socket(AF_UNIX,SOCK_DGRAM,0); /*create a socket */ bind(fd,&sock,sizeof(sock.sun_family)+1+strlen(sokname)) /*binding tjhe socket */ icotl(fd,FIOASYNC,(char*)&fioasync) /* setting flag for async I/O */ icotl(fd,SIOCSPGRP,(char*)&pid) /* set process group pid for signal */ signal(SIGIO,sig_handler) sigpause(SIGIO) . . /* END SERVER */ /* CLIENT */ struct sockaddr_un sock; fd=socket(AF_UNIX,SOCK_DGRAM,0); /*create a socket */ bind(fd,&sock,sizeof(sock.sun_family)+1+strlen(sokname)) /*binding the socket */ icotl(fd,FIOASYNC,(char*)&fioasync) /* setting flag for async I/O */ icotl(fd,SIOCSPGRP,(char*)&pid) /* set process group pid for signal */ signal(SIGIO,sig_handler) . . sendto(fd,...) /*sendto SERVER */ . . . sigpause(SIGIO) . /* END CLIENT */ sig_handler() performs recvfrom for the CLIENT and recvfrom & sendto for the SERVER. We would like to hear from people who have had similar experiance or success!! -- Regards pau ( pau@stl.stc.co.uk +44-279-29531 )