1# test EPROTONOSUPPORT for splicing tcp to udp socket
2
3use strict;
4use warnings;
5use IO::Socket::IP;
6use BSD::Socket::Splice "SO_SPLICE";
7
8our %args = (
9    errno => 'EPROTONOSUPPORT',
10    func => sub {
11	my $s = IO::Socket::IP->new(
12	    Proto => "udp",
13	) or die "socket failed: $!";
14
15	my $ss = IO::Socket::IP->new(
16	    Proto => "tcp",
17	) or die "socket splice failed: $!";
18
19	$s->setsockopt(SOL_SOCKET, SO_SPLICE, pack('i', $ss->fileno()))
20	    and die "splice udp to tcp socket succeeded";
21    },
22);
23