Name

SPVM::Sys::Socket::Util - Socket Utilities

Description

The Sys::Socket::Util class of SPVM has methods for socket utilities.

Usage

use Sys::Socket::Util;

Class Methods

sockaddr_in

static method sockaddr_in : Sys::Socket::Sockaddr::In ($port : int, $in_addr : Sys::Socket::In_addr);

Creates a Sys::Socket::Sockaddr::In object given a port $port and a Sys::Socket::In_addr object $in_addr, and returns it.

The address family is set to AF_INET.

Exceptions:

The $in_addr must be defined. Otherwise an exception is thrown.

sockaddr_in6

static method sockaddr_in6 : Sys::Socket::Sockaddr::In6 ($port : int, $in6_addr : Sys::Socket::In6_addr);

Creates a Sys::Socket::Sockaddr::In6 object given a port $port and a Sys::Socket::In6_addr object $in_addr, and returns it.

The address family is set to AF_INET6.

Exceptions:

The $in6_addr must be defined. Otherwise an exception is thrown.

sockaddr_un

static method sockaddr_un : Sys::Socket::Sockaddr::Un ($path : string);

Creates a Sys::Socket::Sockaddr::Un object given a path $path, and returns it.

The address family is set to AF_UNIX.

Exceptions:

The $path must be defined. Otherwise an exception is thrown.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License