TypeError when passing loop as first argument into React\Socket\Server
#523
-
Hi everyone, thankyou for the great work done on this library. its my first time using it, but am having this error below please help me.
(Updated by @clue to add appropriate code block, please take the time to properly format your comments.) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
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 The I can only make assumptions here, but maybe you're installing a very old version of either one of the ReactPHP components or an (old) version of a project using ReactPHP, which installs old ReactPHP versions. Hope this helps 👍 FYI: I converted this ticket to a discussion so we give it some more visibility for other users with the same question. I also renamed the title to give it a more precise description of what this ticket is about. |
Beta Was this translation helpful? Give feedback.
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 aTypeError
because the first argument expects a URI of the type string. You can take a look at theReact\Socket\Server
implementation with it's constructor parameters here: https://github.com/reactphp/socket/blob/1.x/src/Server.php#L52The
React\Socket\Server
is also deprecated since thev1.9.0
release of reactphp/socket and got replaced withReact\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…