unix_server() is not commonly used, only t/httpd-corner.t uses
it and most HTTP tests use TCP since most HTTP libraries only
support TCP.
)
}
-sub unix_server ($) {
- my $s = IO::Socket::UNIX->new(
- Listen => 1024,
- Type => Socket::SOCK_STREAM(),
- Local => $_[0],
- );
- $s->blocking(0);
- $s;
-}
-
sub tcp_connect {
my ($dest, %opt) = @_;
my $s = IO::Socket::INET->new(
setsockopt($sock, SOL_SOCKET, $var, $accf_arg) or die "setsockopt: $!";
}
+sub unix_server ($) {
+ my $s = IO::Socket::UNIX->new(
+ Listen => 1024,
+ Type => Socket::SOCK_STREAM(),
+ Local => $_[0],
+ );
+ $s->blocking(0);
+ $s;
+}
+
my $upath = "$tmpdir/s";
my $unix = unix_server($upath);
ok($unix, 'UNIX socket created');