Name
Test::SPVM::Sys::Socket::Util - Socket Utility Functions for SPVM::Sys::Socket
Description
Test::SPVM::Sys::Socket::Util module has functions for socket utilities for SPVM::Sys::Socket.
Usage
use Test::SPVM::Sys::Socket::Util;
my $port = Test::SPVM::Sys::Socket::Util::get_available_port;
Functions
get_available_port
my $port = Test::SPVM::Sys::Socket::Util::get_available_port;
Gets an available port and returns it.
can_bind
my $can_bind = Test::SPVM::Sys::Socket::Util::::can_bind($host, $port, $proto);
Checks if bind system call succeeds given the host $host, the port $port, the protocal $proto.
If it succeeds, returns 1, otherwise returns 0.