5 use Test::More tests => 4;
14 my $msg = 'ssleay-tcp-test';
17 my $ip = "\x7F\0\0\x01";
18 my $serv_params = pack('S n a4 x8', AF_INET, $port, $ip);
20 socket($sock, AF_INET, SOCK_STREAM, 0) or die;
21 bind($sock, $serv_params) or die;
22 listen($sock, 2) or die;
27 die unless defined $pid;
29 my $addr = accept(Net::SSLeay::SSLCAT_S, $sock) or die;
31 my $old_out = select(Net::SSLeay::SSLCAT_S);
35 my $got = Net::SSLeay::tcp_read_all();
36 is($got, $msg, 'tcp_read_all');
38 ok(Net::SSLeay::tcp_write_all(uc($got)), 'tcp_write_all');
40 close Net::SSLeay::SSLCAT_S;
49 my ($got) = Net::SSLeay::tcpcat('localhost', $port, $msg);
50 push @results, [ $got eq uc($msg), 'sent and recieved correctly' ];
54 push @results, [ $? == 0, 'server exited with 0' ];
57 Test::More->builder->current_test(2);
58 for my $t (@results) {
59 ok( $t->[0], $t->[1] );