struct

Socket::Address

Inherits Struct / Value / Object

Constructors

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.

Source
from(sockaddr : Pointer(LibC::Sockaddr)) : Address

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

Source
new(family : Family, size : Int32)
Source
parse(uri : URI) : self

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.

Source
parse(uri : String) : self

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.

Source

Instance methods

family
Source
size
Source
to_unsafe
Source