PSL - Crown 5.1.0
Features
- TLS connection pooling: New
TLS\TCPConnectorimplementsTCP\ConnectorInterface, enabling TLS connections to be pooled viaTCP\SocketPool. Pass aTCPConnectortoSocketPooland get automatic connection reuse without repeated TLS handshakes. TLS\StreamInterfacenow extendsTCP\StreamInterface, making TLS streams compatible with any API that accepts TCP streams.
Example
$pool = new TCP\SocketPool(
new TLS\TCPConnector(
new TCP\Connector(),
new TLS\Connector($config),
),
);
$stream = $pool->checkout('example.com', 443);
// ... use stream ...
$pool->checkin($stream);
// Next checkout reuses the TLS connection
$stream = $pool->checkout('example.com', 443);Full Changelog: 5.0.0...5.1.0