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