Releases: reactphp/socket
v0.8.1
-
Feature: Forward compatibility with upcoming EventLoop v1.0 and v0.5 and
target evenement 3.0 a long side 2.0 and 1.0
(#104 by @clue and #111 by @WyriHaximus) -
Improve test suite by locking Travis distro so new defaults will not break the build and
fix HHVM build for now again and ignore future HHVM build errors
(#109 and #110 by @clue) -
Minor documentation fixes
(#103 by @christiaan and #108 by @hansott)
v0.8.0
-
Feature: New
Serverclass now acts as a facade for existing server classes
and renamed oldServertoTcpServerfor advanced usage.
(#96 and #97 by @clue)The
Serverclass is now the main class in this package that implements the
ServerInterfaceand allows you to accept incoming streaming connections,
such as plaintext TCP/IP or secure TLS connection streams.This is not a BC break and consumer code does not have to be updated.
-
Feature / BC break: All addresses are now URIs that include the URI scheme
(#98 by @clue)- $parts = parse_url('tcp://' . $conn->getRemoteAddress()); + $parts = parse_url($conn->getRemoteAddress());
-
Fix: Fix
unix://addresses for Unix domain socket (UDS) paths
(#100 by @clue) -
Feature: Forward compatibility with Stream v1.0 and v0.7
(#99 by @clue)
v0.7.2
v0.7.1
v0.7.0
-
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
ConnectionInterfaceis 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 latestv0.7.0release 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('…'); });
v0.6.0
-
Feature: Add
LimitingServerto limit and keep track of open connections
(#86 by @clue)$server = new Server(0, $loop); $server = new LimitingServer($server, 100); $server->on('connection', function (ConnectionInterface $connection) { $connection->write('hello there!' . PHP_EOL); … });
-
Feature / BC break: Add
pause()andresume()methods to limit active
connections
(#84 by @clue)$server = new Server(0, $loop); $server->pause(); $loop->addTimer(1.0, function() use ($server) { $server->resume(); });
v0.5.1
v0.5.0
-
Feature / BC break: Replace
listen()call with URIs passed to constructor
and reject listening on hostnames withInvalidArgumentException
and replaceConnectionExceptionwithRuntimeExceptionfor consistency
(#61, #66 and #72 by @clue)// old $server = new Server($loop); $server->listen(8080); // new $server = new Server(8080, $loop);
Similarly, you can now pass a full listening URI to the constructor to change
the listening host:// old $server = new Server($loop); $server->listen(8080, '127.0.0.1'); // new $server = new Server('127.0.0.1:8080', $loop);
Trying to start listening on (DNS) host names will now throw an
InvalidArgumentException, use IP addresses instead:// old $server = new Server($loop); $server->listen(8080, 'localhost'); // new $server = new Server('127.0.0.1:8080', $loop);
If trying to listen fails (such as if port is already in use or port below
1024 may require root access etc.), it will now throw aRuntimeException,
theConnectionExceptionclass has been removed:// old: throws React\Socket\ConnectionException $server = new Server($loop); $server->listen(80); // new: throws RuntimeException $server = new Server(80, $loop);
-
Feature / BC break: Rename
shutdown()toclose()for consistency throughout React
(#62 by @clue)// old $server->shutdown(); // new $server->close();
-
Feature / BC break: Replace
getPort()withgetAddress()
(#67 by @clue)// old echo $server->getPort(); // 8080 // new echo $server->getAddress(); // 127.0.0.1:8080
-
Feature / BC break:
getRemoteAddress()returns full address instead of only IP
(#65 by @clue)// old echo $connection->getRemoteAddress(); // 192.168.0.1 // new echo $connection->getRemoteAddress(); // 192.168.0.1:51743
-
Feature / BC break: Add
getLocalAddress()method
(#68 by @clue)echo $connection->getLocalAddress(); // 127.0.0.1:8080
-
BC break: The
ServerandSecureServerclass are now markedfinal
and you can no longerextendthem
(which was never documented or recommended anyway).
Public properties and event handlers are now internal only.
Please use composition instead of extension.
(#71, #70 and #69 by @clue)