abstract struct Socket::Address

Direct Known Subclasses

Defined in:

socket/address.cr

Constructors

Instance Method Summary

Constructor Detail

def self.from(sockaddr : Pointer(LibC::Sockaddr), addrlen) : AddressSource

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

def self.new(family : Family, size : Int32)Source

def self.parse(uri : URI) : selfSource

Parses a Socket::Address from an URI.

Supported formats:

  • ip://:
  • tcp://:
  • udp://:
  • unix://

See IPAddress.parse and UNIXAddress.parse for details.

def self.parse(uri : String) : selfSource

Parses a Socket::Address from an URI.

Supported formats:

  • ip://:
  • tcp://:
  • udp://:
  • unix://

See IPAddress.parse and UNIXAddress.parse for details.

Instance Method Detail

def family : FamilySource

def size : Int32Source

abstract def to_unsafe : Pointer(LibC::Sockaddr)Source

© 2012–2021 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/1.2.1/Socket/Address.html