Skip to content

abstract struct Socket::Address
inherits Struct

Direct known subclasses

Socket::IPAddress Socket::UNIXAddress

Class methods

.parse(uri : URI)

Parses a Socket::Address from an URI.

Supported formats: * ip://<host>:<port> * tcp://<host>:<port> * udp://<host>:<port> * unix://<path>

See IPAddress.parse and UNIXAddress.parse for details.

View source

.parse(uri : String)

Parses a Socket::Address from an URI.

Supported formats: * ip://<host>:<port> * tcp://<host>:<port> * udp://<host>:<port> * unix://<path>

See IPAddress.parse and UNIXAddress.parse for details.

View source

.from(sockaddr : Pointer(LibC::Sockaddr), addrlen) : Address

Returns either an IPAddress or UNIXAddress from the internal OS representation. Only INET, INET6 and UNIX families are supported.

View source

.new(family : Family, size : Int32)

View source

Methods

#family : Family

View source

#size : Int32

View source

abstract #to_unsafe : Pointer(LibC::Sockaddr)

View source