Amphp Socket Versions Save

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

v2.3.1

3 weeks ago

What's Changed

  • Make implicit nullable types explicit to avoid deprecation notice in PHP 8.4.

Full Changelog: https://github.com/amphp/socket/compare/v2.3.0...v2.3.1

v1.2.1

1 month ago

What's Changed

Full Changelog: https://github.com/amphp/socket/compare/v1.2.0...v1.2.1

v2.3.0

1 month ago
  • Added Socks5SocketConnector to connect to hosts via SOCKS5 proxies. A similar implementation was previously present in amphp/http-tunnel.

v2.2.4

2 months ago

What's Changed

  • Removed missed call to stream_context_set_option(), which was causing a deprecation notice on PHP 8.3.

Full Changelog: https://github.com/amphp/socket/compare/v2.2.3...v2.2.4

v2.2.3

3 months ago

What's Changed

  • Updated deprecated use of stream_context_set_option() on PHP 8.3.

Full Changelog: https://github.com/amphp/socket/compare/v2.2.2...v2.2.3

v2.2.2

4 months ago

What's Changed

  • Fixed bind errors being hidden when connecting in DnsSocketConnector ( #108).

Full Changelog: https://github.com/amphp/socket/compare/v2.2.1...v2.2.2

v2.2.1

5 months ago

What's Changed

  • Updated the default chunk size in ResourceUdpSocket to match the maximum UDP payload length.

Full Changelog: https://github.com/amphp/socket/compare/v2.2.0...v2.2.1

v2.2.0

8 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/amphp/socket/compare/v2.1.0...v2.2.0

v2.1.0

1 year ago

What's Changed

Full Changelog: https://github.com/amphp/socket/compare/v2.0.0...v2.1.0

v2.0.0

1 year ago

Stable release compatible with AMPHP v3 and fibers! 🎉

As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.

See some of the changes in v2.0 of amphp/byte-stream since this library extends several of the interfaces in that library, particularly ReadableStream and WritableStream.

  • Moved methods from the EncryptableSocket interface to Socket and removed EncryptableSocket
  • Changed SocketAddress to an interface with two implementations: InternetAddress and UnixAddress
    • These implementations 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.
  • Added connectTls function
  • Added bindUdpSocket function
  • Added ResourceUdpSocket and UdpSocket interface
  • Added ServerSocketFactory interface for creating ServerSocket instances along with an implementation ResourceServerSocketFactory
  • Renamed createPair function to createSocketPair
  • Renamed connector to socketConnector
  • Renamed Server to ResourceServerSocket and introduced ServerSocket interface
    • ResourceServerSocket::__construct() requires a BindContext instance
  • Renamed Connector to SocketConnector
  • Renamed DnsConnector to DnsSocketConnector
  • Renamed StaticConnector to StaticSocketConnector
  • Removed chunk size from BindContext, use chunk size parameters on listen / bindUdpSocket instead
  • Max attempts has been removed from ConnectContext in favor of a constructor parameter to RetrySocketConnector
  • 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.
  • Default required TLS version is now 1.2+ instead of 1.0+

Changes from 2.0.0 Beta 9

  • Moved methods from the EncryptableSocket interface to Socket and removed EncryptableSocket
  • Renamed SocketServer to ServerSocket
  • Renamed SocketServerFactory to ServerSocketFactory