Skip to content

2.0.0

Compare
Choose a tag to compare
@trowski trowski released this 01 Feb 00:03
· 27 commits to 2.x since this release
v2.0.0
d43bbbe

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