Skip to content

Latest commit

 

History

History
256 lines (183 loc) · 5.16 KB

NetAddress.ru.md

File metadata and controls

256 lines (183 loc) · 5.16 KB

NetAddress

  • класс NetAddress (php\net\NetAddress)
  • пакет std
  • исходники php/net/NetAddress.php

Описание

Class NetAddress


Статичные Методы


Методы


Статичные Методы

getAllByName()

NetAddress::getAllByName(string $host): NetAddress[]

getByAddress()

NetAddress::getByAddress(int[] $address): NetAddress

getLoopbackAddress()

NetAddress::getLoopbackAddress(): NetAddress

Returns the loopback address.

The NetAddress returned will represent the IPv4 loopback address, 127.0.0.1, or the IPv6 loopback address, ::1. The IPv4 loopback address returned is only one of many in the form 127...*


getLocalHost()

NetAddress::getLocalHost(): NetAddress

Returns the address of the local host. This is achieved by retrieving the name of the host from the system, then resolving that name into an NetAddress.


Методы

__construct()

__construct(string $host): void

Determines the IP address of a host, given the host's name.


hostName()

hostName(): string

Gets the host name for this IP address.


hostAddress()

hostAddress(): string

Returns the IP address string in textual presentation.


address()

address(): int[]

Returns the raw IP address of this NetAddress object. The result is in network byte order: the highest order byte of the address is in address()[0].


canonicalHostName()

canonicalHostName(): string

Gets the fully qualified domain name for this IP address. Best effort method, meaning we may not be able to return the FQDN depending on the underlying system configuration.


__toString()

__toString(): string

isReachable()

isReachable(int $timeout): bool

Test whether that address is reachable. Best effort is made by the implementation to try to reach the host, but firewalls and server configuration may block requests resulting in a unreachable status while some specific ports may be accessible. A typical implementation will use ICMP ECHO REQUESTs if the privilege can be obtained, otherwise it will try to establish a TCP connection on port 7 (Echo) of the destination host.


isSiteLocalAddress()

isSiteLocalAddress(): bool

isMulticastAddress()

isMulticastAddress(): bool

isAnyLocalAddress()

isAnyLocalAddress(): bool

isLoopbackAddress()

isLoopbackAddress(): bool

isLinkLocalAddress()

isLinkLocalAddress(): bool

isMCGlobal()

isMCGlobal(): bool

isMCNodeLocal()

isMCNodeLocal(): bool

isMCLinkLocal()

isMCLinkLocal(): bool

isMCSiteLocal()

isMCSiteLocal(): bool

isMCOrgLocal()

isMCOrgLocal(): bool