Closed designermonkey closed 1 year ago
When I tried to use
0
as a port, my code worked fine, but I did notice that it echoed twice. Does this mean that it is being run twice? That would indeed cause an error, but I cannot for the life of me figure out why it would run twice.
Do you mean you are seeing this line twice? If yes, then yes it's being run twice.
Listening on http://0.0.0.0:1337
Just tried your script and had no issues starting it. What is the list of packages installed?
@designermonkey I also tried out the example and it works fine on my system. I don't think this is a bug in https://github.com/reactphp, so I'll close this for now.
I'd suggest to open up a new discussion in our Q&A category and we can discuss your problem further in there. Can you also give us a bit more information about the steps you took to get there, this can help us to reproduce the exact same pattern and find an answer.
I hate when this happens: Interestingly, if I run it as a shell executable with #!/usr/bin/env php
at the top, it works fine... It now also works fine without the hashbang.
Why does code do this to us? Thanks for your time though.
Using the code below (very similar to the examples), I cannot create a socket connection without getting an error. I've tried multiple IP and port combinations of
127.0.0.1
and0.0.0.0
and many ports that I know are free, both in a Docker container specifically built for PHP CLI, and on my local PHP 8.2 install.My code:
My error:
I looked into the TcpServer and found where it was trying to make a socket connection, so I tried it myself:
This above seems to work fine, so I don't understand why it doesn't ever work in the ReactPHP code.
When I tried to use
0
as a port, my code worked fine, but I did notice that it echoed twice. Does this mean that it is being run twice? That would indeed cause an error, but I cannot for the life of me figure out why it would run twice.Any help would be appreciated.