Skip to content

v0.7.0

Compare
Choose a tag to compare
@clue clue released this 10 Apr 12:10
· 356 commits to 3.x since this release
  • Feature: Merge SocketClient component into this component
    (#87 by @clue)

    This means that this package now provides async, streaming plaintext TCP/IP
    and secure TLS socket server and client connections for ReactPHP.

    $connector = new React\Socket\Connector($loop);
    $connector->connect('google.com:80')->then(function (ConnectionInterface $conn) {
        $connection->write('');
    });

    Accordingly, the ConnectionInterface is now used to represent both incoming
    server side connections as well as outgoing client side connections.

    If you've previously used the SocketClient component to establish outgoing
    client connections, upgrading should take no longer than a few minutes.
    All classes have been merged as-is from the latest v0.7.0 release with no
    other changes, so you can simply update your code to use the updated namespace
    like this:

    // old from SocketClient component and namespace
    $connector = new React\SocketClient\Connector($loop);
    $connector->connect('google.com:80')->then(function (ConnectionInterface $conn) {
        $connection->write('');
    });
    
    // new
    $connector = new React\Socket\Connector($loop);
    $connector->connect('google.com:80')->then(function (ConnectionInterface $conn) {
        $connection->write('');
    });