Skip to content

TypeError when passing loop as first argument into React\Socket\Server #523

Answered by SimonFrings
eric-lancelot asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @eric-lancelot, I can't see the exact code, but it seems like you're trying to pass the event loop as a first argument into React\Socket\Server which results in a TypeError because the first argument expects a URI of the type string. You can take a look at the React\Socket\Server implementation with it's constructor parameters here: https://github.com/reactphp/socket/blob/1.x/src/Server.php#L52

The React\Socket\Server is also deprecated since the v1.9.0 release of reactphp/socket and got replaced with React\Socket\SocketServer. We would always recommend to use the latest version of this package if possible (current version is v1.13.0).

I can only make assumptions here, but maybe you'r…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@SimonFrings
Comment options

@eric-lancelot
Comment options

@eric-lancelot
Comment options

@eric-lancelot
Comment options

@SimonFrings
Comment options

Answer selected by SimonFrings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #522 on July 10, 2023 10:11.