… | |
… | |
3 | IO::FDPass - pass a file descriptor over a socket |
3 | IO::FDPass - pass a file descriptor over a socket |
4 | |
4 | |
5 | =head1 SYNOPSIS |
5 | =head1 SYNOPSIS |
6 | |
6 | |
7 | use IO::FDPass; |
7 | use IO::FDPass; |
|
|
8 | |
|
|
9 | IO::FDPass::send fileno $socket, fileno $fh_to_pass |
|
|
10 | or die "send failed: $!"; |
|
|
11 | |
|
|
12 | my $fd = IO::FDPass::recv fileno $socket; |
|
|
13 | $fd >= 0 or die "recv failed: $!"; |
8 | |
14 | |
9 | =head1 DESCRIPTION |
15 | =head1 DESCRIPTION |
10 | |
16 | |
11 | This small low-level module only has one purpose: pass a file descriptor |
17 | This small low-level module only has one purpose: pass a file descriptor |
12 | to another process, using a (streaming) unix domain socket (on POSIX |
18 | to another process, using a (streaming) unix domain socket (on POSIX |