Amphp Socket Versions Save

Non-blocking socket and TLS functionality for PHP based on Amp.

v2.0.0-beta.9

1 year ago
  • Fixed compatibility with v2.0 of amphp/dns
  • Fixed DnsException being thrown from DnsSocketConnector if DNS resolution failed. A ConnectException will be thrown instead with the DnsException as the previous exception
  • Fixed TLS state being incorrect in ResourceSocket if TLS setup fails

v2.0.0-beta.8

1 year ago
  • Fixed compatibility with v2.0 of amphp/byte-stream by updating ResourceSocket to implement Traversable.

v2.0.0-beta.7

1 year ago

v2.0.0-beta.6

2 years ago

Update for Closable interface being moved from amphp/byte-stream to amphp/amp.

  • SocketServer and DatagramSocket now extend Amp\Closable instead of Amp\ByteStream\Closable.

v2.0.0-beta.5

2 years ago
  • Fixed compatibility with systems not defining EAGAIN, e.g. Windows

v2.0.0-beta.4

2 years ago
  • Updated interfaces extending ClosableStream (which was renamed to Closable in amphp/byte-stream) to include the onClose method which was added to the interface.

  • SocketAddress has been changed to an interface with two implementations - InternetAddress and UnixAddress. These can be differentiated using SocketAddress::getType(), which returns an enum SocketAddressType with cases Unix and Internet.

  • SocketAddress static constructors have been relocated as functions in the Amp\Socket\SocketAddress namespace.

  • DnsSocketConnector now tries each host returned from a DNS query a single time before failing. Retrying the list is accomplished through a new connector implementation, RetrySocketConnector that can be configured to retry a given number of times with an exponential backoff between attempts.

  • Max attempts has been removed from ConnectContext in favor of a constructor parameter to RetrySocketConnector.

  • Added SocketServerFactory interface for creating SocketServer instances, along with an implementation ResourceSocketServerFactory.

  • EncryptableSocket::getTlsState() now returns an enum TlsState with cases corresponding to the prior constants defined in EncryptableSocket, which have been removed.

v2.0.0-beta.3

2 years ago
  • Require PHP 8.1+
  • Add ServerSocket::getBindContext()
  • Require BindContext in ResourceSocketServer::__construct()
  • Add ServerTlsContext::fromServerResource()
  • Improve DnsSocketConnector error messages to include IP addresses
  • Automatically determine DNS type if bindTo option is used for connections

v2.0.0-beta.2

2 years ago
  • Update to revolt/event-loop 0.2.x

v2.0.0-beta.1

2 years ago
  • Based on fibers instead of promises, so return types changed to avoid Promise
  • Default to TLSv1.2+ instead of TLSv1.0+
  • Added connectTls function
  • Added bindDatagram function
  • Added ResourceDatagramSocket and DatagramSocket interface
  • Renamed createPair function to createSocketPair
  • Renamed connector function to socketConnector
  • Renamed Server to ResourceSocketServer and introduced SocketServer interface
  • Renamed Connector to SocketConnector
  • Renamed DnsConnector to DnsSocketConnector
  • Renamed StaticConnector to StaticSocketConnector
  • Removed chunk size from BindContext, use parameters on listen / bindDatagram instead

v1.2.0

2 years ago
  • Add support for TLS 1.3 (#82)