DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Interprocess communication using UNIX domain sockets

Socketpairs (UNIX domain only)

Another entity which provides similar functionality to pipes is a socketpair. A pipe is a pair of connected sockets for one-way stream communication. Socketpairs allow two-way stream communication, and are provided by UNIX as a slight generalization of pipes. To obtain a socketpair for two-way stream communication, call the routine socketpair. Because socketpairs are an extension of pipes, their use resembles that of pipes rather than that of standard UNIX domain sockets.

socketpair takes as arguments a specification of a domain, a style of communication, and a protocol (which must be set to 0). Socketpairs have been implemented for the UNIX domain only. Like other sockets in the UNIX domain, they use UNIX pathnames for naming sockets, and only allow communication between sockets on the same machine.

For an example using socketpairs, see ``Using Socketpairs''.


Next topic: Networking library routines for UNIX sockets
Previous topic: Input/Output multiplexing (UNIX domain)

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003