The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Name

SPVM::Sys::Socket::Sockaddr - struct sockaddr in the C language

Description

Sys::Socket::Sockaddr class in SPVM represents struct sockaddr in the C language.

Usage

  use Sys::Socket::Sockaddr;

Details

This class is a pointer class. The pointer the instance has is set to a struct sockaddr object.

Interfaces

Cloneable

Class Methods

new

static method new : Sys::Socket::Sockaddr ();

Creates a new Sys::Socket::Sockaddr object.

new_with_family

static method new_with_family : Sys::Socket::Sockaddr ($family : int);

Creates a new Sys::Socket::Sockaddr::In object or a new Sys::Socket::Sockaddr::In6 object or a new Sys::Socket::Sockaddr::In object according to the socket family $family, and returns it.

Excetpions:

If the address famil is not available, an exception is thrown.

Instance Methods

DESTROY

method DESTROY : void ();

The destructor.

sa_family

method sa_family : int ()

Returns sa_family.

set_sa_family

method sa_family : int ()

Sets sa_family.

sizeof

method size : int ()

Returns the size of the structure. This method is planed to be implemented in a child class.

Exception:

Not implemented.

clone

method clone : Sys::Socket::Sockaddr ();

Clones this instance. This method is planed to be implemented in a child class.

Exception:

Not implemented.

upgrade

method upgrade : Sys::Socket::Sockaddr ();

Returns a new Sys::Socket::Sockaddr::In object, or a new Sys::Socket::Sockaddr::In6 object, or a new Sys::Socket::Sockaddr::Un object according to "sa_family".

Exceptions:

If the address family is not available, an exception is thrown.

Well Known Child Classes

Sys::Socket::Sockaddr::In
Sys::Socket::Sockaddr::In6
Sys::Socket::Sockaddr::Un
Sys::Socket::Sockaddr::Storage

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License