arthurkushman / php-wss

Web-socket server/client with multi-process and parse templates support on server and send/receive options on client
MIT License
210 stars 32 forks source link

Websocket limits Timeout and Clients per Fork #63

Closed jeankassio closed 2 years ago

jeankassio commented 2 years ago

Is there any way to set Timeout forever and infinite Clients per Fork? Or should I just put a big enough number? Because I'm using it to replace the websocket of an exchange.

PS: I loved your code, put a Sponsor that accepts bitcoin :)

arthurkushman commented 2 years ago

Hi, as stated here - https://www.php.net/manual/en/function.stream-select.php: "If seconds is null stream_select() can block indefinitely, returning only when an event on one of the watched streams occurs (or if a signal interrupts the system call)." So, yes the timeout can be set to wait forever, until an event is occurred, but for this to take effect I need to make streamSelectTimeout prop to be null-able. Will make PR as soon as can get hands on it.

Clients per fork - here u can simply set 100500 or whatever amount of clients per fork u like.

PS thx for proposition of bitcoin sponsorship alternative

arthurkushman commented 2 years ago

Hi again, why did u want to close this issue? ) Is something goes wrong?

jeankassio commented 2 years ago

Oh sorry, I translate wrong, my bad. Chrome's automatic translator gave me to understand that it was already implemented, I put it in Google translator and I understand now, my apologies. I'm brazilian and my english is a little bad

arthurkushman commented 2 years ago

No worries, your english is ok, everything is fine, I will implement code later 👌🏻

arthurkushman commented 2 years ago

Hi @jeankassio, here is the release with an ability to set $streamSelectTimeout=null - https://github.com/arthurkushman/php-wss/releases/tag/2.0.4