-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
connection.on('data' ...) never fires while opening more than 255 sockets #198
Comments
maybe I should mention that I am using win10 x64. I have started with few ports and everything was working but as soon as I increased the number to more than 255, the events never fire for the entire range. Could it be php/windows issue ? |
Good point I tried on Linux yesterday, will try on windows 10 now hold on |
@Saif-A Interesting find! It looks like this might indeed be a limitation of the platform you're using. Other platforms (see @WyriHaximus's post) are known to support a much larger number of sockets. This project builds on top of the APIs that your platform and PHP provides, so I don't think there's much we can do here to avoid this. I did a quick search and could not find any references for any limitations in Windows that would limit this to 255 sockets though. If you happen to find a way to configure this on the OS level, then this should also take effect for this library (please share your findings!). In your case, the connection should either succeed successfully with the I believe this has been answered and don't think there's much we can do here, so I'm closing this for now. Please come back with more details if this problem persists and we can reopen this 👍 |
Can confirm that snippet doesn't work on directly Windows 10 (x64), but it does work in WSL on Windows 10 (x64). So going for WSL is probably you best development bet @Saif-A |
Hi,
I was able to open 1000 socket without any issues using node.JS on the same
machine so I can confirm it is not the OS fault, but it might be php on
windows. In ReactPHP case, it listens on all the 1000 ports and
actually connects with the clients, it is just the on("data" ... ) never
fires.
used PHP : PHP 7.2.8 (cli) (built: Jul 18 2018 10:18:27) ( ZTS MSVC15
(Visual C++ 2017) x86 )
thanks
…On Sun, Apr 7, 2019 at 12:29 PM Cees-Jan Kiewiet ***@***.***> wrote:
Can confirm that snippet doesn't work on directly Windows 10 (x64), but it
does work in WSL on Windows 10 (x64). So going for WSL is probably you best
development bet @Saif-A <https://github.com/Saif-A>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#198 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKqYjPILvlQwLLF2Kg25xnK4xaIBz9Koks5vebqWgaJpZM4ce28s>
.
|
@Saif-A I don't see anything special that we're doing in this library that could be the cause of this. Can you try reproducing this with plain PHP without ReactPHP to see if this is an issue in PHP and/or the platform? Here's some pseudo code to get you started:
|
@Saif-A I just stumbled upon https://docs.microsoft.com/en-us/windows/desktop/winsock/maximum-number-of-sockets-supported-2 which suggests On Unix platforms, this constant is usually defined as |
Hello. I have the same problem (Windows 10 64 bits PHP 7.3.3). Someone has some other solution or workaround? Thanks |
@leocharrua Can you provide a gist to reproduce the problem you're seeing? If you're using the default If you want to stick to the default |
Hello @clue, thanks for your help. We have a tcp server that accepts conections from multiple clients at the same time. Now, we are stuck with this limitation of 255 sockets, because we have more than 255 devices sending data to the server, and we have data lost. The StreamSelectLoop can help? I don't know how, can you explain a little more?. Thanks |
@leocharrua May I ask you to file an issue in https://github.com/reactphp/event-loop with more details and a link back to this issue? A short gist to reproduce this and details about your platform would be helpful 👍 |
I am trying to start ReactPHP TCP sockets on a range of TCP ports (1000 to 2000). All the ports are open and I can see the connection established while testing using telnet but the sockets never fires the connection.on('data' ...) event. Everything works while using a smaller port range of exactly 255 socket instead of 1000.
reproduce code :
The text was updated successfully, but these errors were encountered: