StaticSocketConnector
in package
implements
SocketConnector
uses
ForbidCloning, ForbidSerialization
FinalYes
Connector that connects to a statically defined URI instead of the URI passed to the {@code connect()} call.
Table of Contents
Interfaces
Properties
- $connector : SocketConnector
- $uri : SocketAddress|string
Methods
- __construct() : mixed
- __serialize() : never
- __unserialize() : never
- connect() : Socket
- Establish a socket connection to the specified URI.
- __clone() : mixed
Properties
$connector read-only
private
SocketConnector
$connector
$uri read-only
private
SocketAddress|string
$uri
Methods
__construct()
public
__construct(SocketAddress|string $uri, SocketConnector $connector) : mixed
Parameters
- $uri : SocketAddress|string
- $connector : SocketConnector
__serialize()
public
final __serialize() : never
Return values
never__unserialize()
public
final __unserialize(array<string|int, mixed> $data) : never
Parameters
- $data : array<string|int, mixed>
Return values
neverconnect()
Establish a socket connection to the specified URI.
public
connect(SocketAddress|string $uri[, ConnectContext|null $context = null ][, Cancellation|null $cancellation = null ]) : Socket
Parameters
- $uri : SocketAddress|string
-
URI in scheme://host:port format. TCP is assumed if no scheme is present.
- $context : ConnectContext|null = null
-
Socket connect context to use when connecting.
- $cancellation : Cancellation|null = null
Return values
Socket__clone()
protected
final __clone() : mixed