about summary refs log tree commit homepage
path: root/t/httpd-corner.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-09-02 04:51:31 +0000
committerEric Wong <e@80x24.org>2019-09-09 01:59:23 +0000
commit7f3f4923ec711ec97a1204ec2c080e219f50ff3b (patch)
tree0f15ed7624754eda339fc31d8889ba1407e0241c /t/httpd-corner.t
parent16d96f80e55d3f40338101ee8641e03f3b4f2d64 (diff)
downloadpublic-inbox-7f3f4923ec711ec97a1204ec2c080e219f50ff3b.tar.gz
IO::Socket::INET->new is rather verbose with the options hash,
extract it into a standalone sub
Diffstat (limited to 't/httpd-corner.t')
-rw-r--r--t/httpd-corner.t9
1 files changed, 2 insertions, 7 deletions
diff --git a/t/httpd-corner.t b/t/httpd-corner.t
index 35318b50..c72bc9c6 100644
--- a/t/httpd-corner.t
+++ b/t/httpd-corner.t
@@ -157,14 +157,9 @@ SKIP: {
 }
 
 sub conn_for {
-        my ($sock, $msg) = @_;
-        my $conn = IO::Socket::INET->new(
-                                PeerAddr => $sock->sockhost,
-                                PeerPort => $sock->sockport,
-                                Proto => 'tcp',
-                                Type => SOCK_STREAM);
+        my ($dest, $msg) = @_;
+        my $conn = tcp_connect($dest);
         ok($conn, "connected for $msg");
-        $conn->autoflush(1);
         setsockopt($conn, IPPROTO_TCP, TCP_NODELAY, 1);
         return $conn;
 }