Got stuck on using Net::HTTP when i create a Net::HTTP object it initialize with "IO::Socket::IP". how can i change default socket without hard-coding? I would like to change it to IO::Socket::INET.
So if i hard-code socket, it works. But when i'm trying to use Coro::LWP and Coro::LWP changes IO::Socket::INET to Coro::Socket i got error:
Status read failed: Transport endpoint is not connected at perl5/lib/perl5/Net/HTTP/Methods.pm line 282.
I need to change socket because Clickhouse module on cpan doesn't support async requests.
here is code that doesn't work
use IO::Socket::INET qw( );
BEGIN { $Net::HTTP::SOCKET_CLASS = 'IO::Socket::INET'; };
use Coro::LWP;
my $s = Net::HTTP->new(Host => "www.perl.com") || die $@;
$s->write_request(GET => "/");
print $_ for ( $s->read_response_headers );
fixed! just change Coro::Socket with Coro::PatchSet::Socket