Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

stSocketAddress

An IPv4 or IPv6 endpoint - address, port and IPv6 zone - held WITHOUT any
  platform socket type, so that it can travel through units that must not
  depend on a socket API (StreamSec.Mobile.AsyncTLSReactor) and through
  protocol code that compares endpoints (a datagram server telling its peers
  apart). The platform units convert it to and from the native sockaddr at
  the system call: stSocket (SocketAddressToNative / SocketAddressFromNative).

  TEXT IS PARSED AND FORMATTED HERE, IN PASCAL, NOT BY THE SYSTEM. The system
  routines differ between targets in exactly the places that matter for a
  comparison: whether an IPv4 part may carry a leading zero (which some read
  as octal), whether hexadecimal may be upper case, and which embedded-IPv4
  forms an IPv6 address is printed in. One rule everywhere:
    - IPv4 is a dotted quad of four decimal parts 0..255, no leading zeros
      ("0" itself is a part, "00" and "01" are not);
    - IPv6 is RFC 4291 section 2.2 text, hexadecimal in either case, with at
      most one "::" and optionally a dotted-quad last 32 bits, and an optional
      zone "%<decimal index>" (an interface NAME is refused: resolving one
      needs the system, and this unit does not call it);
    - IPv6 is printed as RFC 5952 section 4 says: lower case, no leading
      zeros, "::" for the longest run of two or more zero fields (the first
      when two are as long), never for a single field. The dotted last 32 bits
      of section 5 are used for one prefix only, the IPv4-mapped ::ffff:0:0/96,
      which is the case the section names; the deprecated IPv4-compatible form
      (::a.b.c.d) is printed in hexadecimal like any other address.
  A name is never resolved here.

Classes, interfaces and records

recordtSocketAddress

Family: tAddressFamily; Port: Word;
Host order.
Addr: array [0..15] of Byte;
Network order. IPv4 uses Addr[0..3]; the rest is zero.
ScopeId: Cardinal;
IPv6 zone (interface index); 0 = none. Always 0 for IPv4.
function IsValid: Boolean;
False for the default (all zero) value.
function AddressText: string;
The address alone: '192.0.2.1', '2001:db8::1', 'fe80::1%3'.
function ToString: string;
The endpoint: '192.0.2.1:443', '[2001:db8::1]:443'.
function SameAs(const aOther: tSocketAddress): Boolean;
Same family, address, port and zone.
function IsLoopback: Boolean;
127.0.0.0/8 or ::1.
function IsAny: Boolean;
The wildcard: 0.0.0.0 or ::.

classEstSocketAddressError

inherits from Exception

(no public members)

Types (enumerations, sets, aliases)

enumtAddressFamily

  tAddressFamily = (afNone, afIPv4, afIPv6);

enumtDatagramEcn

Unknown means the platform supplied no ECN metadata. Other values name the two ECN bits; they are not a Type-of-Service or DSCP policy.

  tDatagramEcn = (deUnknown, deNotEct, deEct1, deEct0, deCe);

Routines