reactphp / socket

Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP.
https://reactphp.org/socket/
MIT License
1.21k stars 157 forks source link

Drop deprecated `Server` class, use `SocketServer` instead #314

Closed clue closed 5 months ago

clue commented 5 months ago

This simple changeset drops the deprecated Server class from this package. As of v1.9.0, we recommend using the SocketServer class instead to avoid class name collisions, so upgrading should be straightforward for most use cases:

// old (no longer supported)
$socket = new React\Socket\Server(0);
$socket = new React\Socket\Server('127.0.0.1:8000');
$socket = new React\Socket\Server('127.0.0.1:8000', null, $context);
$socket = new React\Socket\Server('127.0.0.1:8000', $loop, $context);

// new (already supported since v1.9.0)
$socket = new React\Socket\SocketServer('127.0.0.1:0');
$socket = new React\Socket\SocketServer('127.0.0.1:8000');
$socket = new React\Socket\SocketServer('127.0.0.1:8000', $context);
$socket = new React\Socket\SocketServer('127.0.0.1:8000', $context, $loop);

The original deprecation message has been in place for a couple of years already, so this should be relatively safe to apply.

Builds on top of #263.