Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: Reference: socketChapter 5
Function Reference
Next: Reference: sort
 

socketpair

socketpair sock1, sock2, domain, type, prtcl

Creates an unnamed pair of sockets in the specified domain and of the specified type. domain, type, and protocol are specified the same as for socketpair(2). If socketpair is unimplemented, invoking this function yields a fatal error. The function returns true if successful.

This function is typically used just before a fork. One of the resulting processes should close sock1, and the other should close sock2. You can use these sockets bidirectionally, unlike the filehandles created by the pipe function.


Previous: Reference: socketPerl in a NutshellNext: Reference: sort
Reference: socketBook IndexReference: sort

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.