Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new SocketServer and deprecate Server to avoid class name collisions #263

Merged
merged 1 commit into from
Jul 27, 2021

Conversation

clue
Copy link
Member

@clue clue 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 = 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
$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 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

@clue clue added this to the v1.9.0 milestone Jul 26, 2021
@clue clue changed the title Add new SocketServer and deprecate Server to avoid class name collisions Add new SocketServer and deprecate Server to avoid class name collisions Jul 26, 2021
@WyriHaximus WyriHaximus self-requested a review July 27, 2021 07:07
README.md Show resolved Hide resolved
@WyriHaximus WyriHaximus merged commit 22d3b31 into reactphp:master Jul 27, 2021
@clue clue deleted the socketserver branch July 27, 2021 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants