SPVM::IO::Socket::INET - IPv4 Socket
use IO::Socket::INET; use Sys::Socket; use Sys::Socket::Constant as SOCKET; # Socket my $host = "google.com"; my $port = 80; my $io_socket = IO::Socket::INET->new({ PeerAddr => $host, PeerPort => $port }); my $io_socket = IO::Socket::INET->new({ PeerAddr => 'www.perl.org', PeerPort => 80, Proto => SOCKET->IPPROTO_TCP }); my $io_socket = IO::Socket::INET->new({ Listen => 5, LocalAddr => 'localhost', LocalPort => 9000, Proto => SOCKET->IPPROTO_TCP }); my $io_socket = IO::Socket::INET->new({ PeerPort => 9999, PeerAddr => Sys::Socket->inet_ntoa(SOCKET->INADDR_BROADCAST), Proto => SOCKET->IPPROTO_UDP, LocalAddr => 'localhost', Broadcast => 1 })
IO::Socket::INET provides IPv4 Socket.
IO::Socket::INET
IO::Socket
has peer_address : string;
has peer_port : int;
has local_address : string;
has local_port : int;
has proto_number : int;
static method new : IO::Socket::INET ($options = undef : object[]);
ReuseAddr : string
ReusePort : Int
Broadcast : Int
PeerAddr : string
PeerPort : Int
LocalAddr : string
LocalPort : Int
Proto : Int
Timeout : Int
Domain : Int
Type : Int
Blocking : Int
Listen : Int
protected method init : void ($options = undef : object[]);
method sockaddr : Sys::Socket::In_addr ();
method sockport : int ();
method sockhost : string ();
method peeraddr : Sys::Socket::In_addr ();
method peerport : int ();
method peerhost : string ();
IO::Socket::INET is a Perl's IO::Socket::INET porting to SPVM.
To install SPVM::IO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM::IO
CPAN shell
perl -MCPAN -e shell install SPVM::IO
For more information on module installation, please visit the detailed CPAN module installation guide.