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