perl-5.38.0
socketpair SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL

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

指定した DOMAIN に、指定した TYPE で名前の無いソケットのペアを生成します。 DOMAIN, TYPE, PROTOCOL は、同名のシステムコールと同じように指定します。 実装されていない場合には、例外が発生します。 成功時には真を返します。

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

ファイルに対する close-on-exec フラグをサポートしているシステムでは、 フラグは $^F の値で決定される、新しくオープンされた ファイル記述子に対してセットされます。 "$^F" in perlvar を参照してください。

Some systems define pipe in terms of socketpair, in which a call to pipe($rdr, $wtr) is essentially:

pipesocketpair を使って 定義しているシステムもあります; pipe($rdr, $wtr) は本質的には以下のようになります:

    use Socket;
    socketpair(my $rdr, my $wtr, AF_UNIX, SOCK_STREAM, PF_UNSPEC);
    shutdown($rdr, 1);        # no more writing for reader
    shutdown($wtr, 0);        # no more reading for writer

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

socketpair の使用例については perlipc を参照してください。 Perl 5.8 以降では、システムがソケットを実装しているが socketpair を 実装していない場合、localhost に対して IP ソケットを使うことで socketpair をエミュレートします。

Portability issues: "socketpair" in perlport.

移植性の問題: "socketpair" in perlport