With named pipes, client processes may communicate with a server process using the module connld that lets a client process get a unique, non-multiplexed connection to a server. The connld(7M) module can be pushed onto the named end of the pipe. If the named end of the pipe is then opened by a client, a new pipe is created. One file descriptor for the new pipe is passed back to a client (named Stream) as the file descriptor from open(2) and the other file descriptor is passed to the server using I_RECUFD ioctl(2). The server and the client may then communicate through a new pipe.
When process X (procx) opens /usr/toserv, it gains a unique connection to the server process that was at one end of the original STREAMS-based pipe. When process Y (procy) does the same, it also gains a unique connection to the server. As shown in Figure 6-4, the server process has access to three separate pipes through three file descriptors.
connld(7M) is a STREAMS-based module that has open, close, and put procedures.
When the named Stream is opened, the open routine of connld(7M) is called. The open fails if:
The pipe ends cannot be created.
A file pointer and file descriptor cannot be allocated.
The Stream-head cannot stream the two pipe ends.
The open is not complete and will block until the server process has received the file descriptor using the ioctl I_RECVFD. The setting of the O_NDELAY or O_NONBLOCK flag has no impact on the open.