about summary refs log tree commit homepage
path: root/t/httpd.t
diff options
context:
space:
mode:
Diffstat (limited to 't/httpd.t')
-rw-r--r--t/httpd.t8
1 files changed, 2 insertions, 6 deletions
diff --git a/t/httpd.t b/t/httpd.t
index e0a2bf44..47ba7acc 100644
--- a/t/httpd.t
+++ b/t/httpd.t
@@ -9,8 +9,7 @@ foreach my $mod (qw(Plack::Util Plack::Builder HTTP::Date HTTP::Status)) {
         plan skip_all => "$mod missing for httpd.t" if $@;
 }
 use File::Temp qw/tempdir/;
-use IO::Socket::INET;
-use Socket qw(IPPROTO_TCP);
+use Socket qw(IPPROTO_TCP SOL_SOCKET);
 require './t/common.perl';
 
 # FIXME: too much setup
@@ -58,10 +57,7 @@ EOF
         $pid = spawn_listener(undef, $cmd, [$sock]);
         my $host = $sock->sockhost;
         my $port = $sock->sockport;
-        my $conn = IO::Socket::INET->new(PeerAddr => $host,
-                                PeerPort => $port,
-                                Proto => 'tcp',
-                                Type => SOCK_STREAM);
+        my $conn = tcp_connect($sock);
         ok($conn, 'connected');
         ok($conn->write("GET / HTTP/1.0\r\n\r\n"), 'wrote data to socket');
         {