Data::Send::Local - Send and receive a block of data between processes on the local machine.
Send hello between two processes running on the same machine over the socket named socket.
use Test2::Bundle::More; my $socket = 'socket'; # Socket name my $data = 'hello'; # Data if (fork()) {ok Data::Send::Local::recvLocal($socket) eq $data; # Receive data } else {ok !Data::Send::Local::sendLocal($socket, $data); # Send data without error } done_testing;
The following sections describe the methods in each functional area of this module. For an alphabetic listing of all methods by name see Index.
Send a block of data locally. Returns undef on success otherwise an error message
1 $socketName Socket name (a socket file name that already exists) 2 $data Data 3 $timeOut Optional timeout for socket to be created - defaults to 10 seconds
This is a static method and so should be invoked as:
Data::Send::Local::sendLocal
Receive a block of data sent locally. Returns the data received.
1 $socketName Socket name (a socket file name that is created) 2 $length Optional maximum length to receive - defaults to one megabyte.
Data::Send::Local::recvLocal
1 recvLocal
2 sendLocal
This module is written in 100% Pure Perl and, thus, it is easy to read, use, modify and install.
Standard Module::Build process for building and installing modules:
perl Build.PL ./Build ./Build test ./Build install
philiprbrenan@gmail.com
http://www.appaapps.com
Copyright (c) 2016-2017 Philip R Brenan.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
To install Data::Send::Local, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Send::Local
CPAN shell
perl -MCPAN -e shell install Data::Send::Local
For more information on module installation, please visit the detailed CPAN module installation guide.