Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Create a socketSysV IPC message control operations (Berikutnya)
Low-level socket functions

Create a pair of sockets

Daftar Isi

  • socketpair SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL

    Creates an unnamed pair of sockets in the specified domain, of thespecified type. DOMAIN, TYPE, and PROTOCOL are specified the same asfor the syscall of the same name. If unimplemented, raises an exception.Returns true if successful.

    On systems that support a close-on-exec flag on files, the flag willbe set for the newly opened file descriptors, as determined by the valueof $^F. See $^F in perlvar.

    Some systems defined pipe in terms of socketpair, in which a callto pipe(Rdr, Wtr) is essentially:

    1. use Socket;
    2. socketpair(Rdr, Wtr, AF_UNIX, SOCK_STREAM, PF_UNSPEC);
    3. shutdown(Rdr, 1); # no more writing for reader
    4. shutdown(Wtr, 0); # no more reading for writer

    See perlipc for an example of socketpair use. Perl 5.8 and later willemulate socketpair using IP sockets to localhost if your system implementssockets but not socketpair.

    Portability issues: socketpair in perlport.

 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) Create a socketSysV IPC message control operations (Berikutnya)