The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

IO::FDpassData - send/receive data and/or file descriptor

SYNOPSIS

  use IO::FDpassData;

  $bytessent = fd_sendata(socket, message, FD);

  ($bytesrcvd, message, FD) = fd_rcvdata(socket, $maxsize);

DESCRIPTION

This module will send and receive data and/or a file descriptor locally over a unix pipe.

  • $bytessent = fd_sendata(socket, message, FD);

      input:        socket file descriptor,
        {optional}  message,                may be zero length string
        {optional}  file descriptor         to send to other process
    
     NOTE: optional message may be 'undef' or zero length string
           optional FD may be omitted, 'undef'
    
      returns:      bytes sent
                or -1 on error
  • ($bytesrcvd, message, FD) = fd_rcvdata(socket, $maxsize);

      input:        socket file descriptor,
                    maximum length to receive       overrun will cause segfault??
    
      returns:      msg bytes received,             or -1 on error
                    message,                may be zero a length string
        {optional}  file descriptor or undef

EXPORTS

  fd_sendata
  fd_recvdata

COPYRIGHT

Copyright Michael Robinton 2019

CREDITS

This package was inspired by an article published by Keith Packard https://keithp.com/blogs/fd-passing/ and the package IO::FDpass written by Marc A. Lehmann

SHORTCOMINGS

At the present time this package does not support Windows. Patches welcome.

LICENSE

This is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or

b) the "Artistic License".

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.