Build Status

NAME

Test::UNIXSock - testing UNIX domain socket program

SYNOPSIS

use Test::UNIXSock;

my $server = Test::UNIXSock->new(
    code => sub {
        my $path = shift;
        ...
    },
);
my $client = MyClient->new( sock => $server->path );
undef $server; # kill child process on DESTROY

Using memcached:

use Test::UNIXSock;

my $memcached = Test::UNIXSock->new(
    code => sub {
        my $path = shift;

        exec $bin, '-s' => $path;
        die "cannot execute $bin: $!";
    },
);
my $memd = Cache::Memcached->new({servers => [$memcached->path]});
...

And functional interface is available:

use Test::UNIXSock;
test_unix_sock(
    client => sub {
        my ($path, $server_pid) = @_;
        # send request to the server
    },
    server => sub {
        my $path = shift;
        # run server
    },
);

DESCRIPTION

Test::UNIXSock is a test utility to test UNIX domain socket server programs.

This is based on Test::TCP.

METHODS

Object Oriented interface interface

FAQ

See also Test::TCP FAQ section.

AUTHOR

Fujiwara Shunichiro fujiwara.shunichiro@gmail.com

SEE ALSO

Test::TCP

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This module is based on Test::TCP. copyright (c) 2013 by Tokuhiro Matsuno tokuhirom@gmail.com.