Skip to content

Conversation

@clue
Copy link
Member

@clueclue commented Jul 26, 2021

This changeset adds a new SocketServer class as a replacement for the Server class to avoid class name collisions and ambiguities.

// deprecated$socket = newReact\Socket\Server(0); $socket = newReact\Socket\Server('127.0.0.1:8000'); $socket = newReact\Socket\Server('127.0.0.1:8000', null, $context); $socket = newReact\Socket\Server('127.0.0.1:8000', $loop, $context); // new$socket = newReact\Socket\SocketServer('127.0.0.1:0'); $socket = newReact\Socket\SocketServer('127.0.0.1:8000'); $socket = newReact\Socket\SocketServer('127.0.0.1:8000', $context); $socket = newReact\Socket\SocketServer('127.0.0.1:8000', $context, $loop);

The new SocketServer class has been added with an improved constructor signature as a replacement for the previous Server class in order to avoid any ambiguities. The previous name has been deprecated and should not be used anymore. In its most basic form, the deprecated Server can now be considered an alias for new SocketServer. Existing code continues to work as-is.

Builds on top of reactphp/http#417 and #260

@clueclue added this to the v1.9.0 milestone Jul 26, 2021
@clueclue changed the title Add new SocketServer and deprecate Server to avoid class name collisionsAdd new SocketServer and deprecate Server to avoid class name collisionsJul 26, 2021
@WyriHaximusWyriHaximus self-requested a review July 27, 2021 07:07
@WyriHaximusWyriHaximus merged commit 22d3b31 into reactphp:masterJul 27, 2021
@clueclue deleted the socketserver branch July 27, 2021 07:12
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@clue@WyriHaximus