-
Notifications
You must be signed in to change notification settings - Fork 374
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
is the example testwebsock.php multi threaded ? #124
Comments
is the example testwebsock.php multi threaded ?
No.
possibily could you post a multi thread version of testwebsock.php please
If someone wants to develop this feature, I'll be happy to review and merge
what they have.
Anyone who does want to develop this feature, please keep in mind that one
of my goals is to keep extension dependencies to a minimum, so if pthreads
is not available, it should fall back gracefully.
I, personally, will not be doing new development on the GitHub version (and
my planned GitLab hosted version is not expected to be compatible with this
version here). (Honestly, the longer I can go without logging in to
GitHub, and just responding to bugs through email replies, the happier I'll
be.)
…On Fri, Oct 25, 2019 at 10:24 AM gfanini ***@***.***> wrote:
is the example testwebsock.php multi threaded ?
you need the pthread posix dll for php on windows in order to enable
threads ?
I don't think so because it should have
extends Thread
client->start()
client->join() to wait for thread exit if needed
such as this pthread example
socket = $socket; } public function run(){ while(++$clients < 10 &&
($client = socket_accept($this->socket))){ printf("Accept in %lu\n",
$this->getThreadId()); var_dump($client); var_dump($this->socket);
socket_close($client); } } } $workers = array(); $sock =
socket_create_listen($argv[1]); if ($sock) { while(++$worker<5){
$workers[$worker] = new Test($sock); $workers[$worker]->start(); }
printf("%d threads waiting on port %d\n", count($workers), $argv[1]); }
foreach ($workers as $thread) $thread->join(); ?>
possibily could you post a multi thread version of testwebsock.php please
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#124?email_source=notifications&email_token=AAB46PTZUX6RSMD6NEHJTTLQQMTTBA5CNFSM4JFF6HT2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HUODV7A>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB46PTQFD76ZK54GOD6HI3QQMTTBANCNFSM4JFF6HTQ>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
is the example testwebsock.php multi threaded ?
you need the pthread posix dll for php on windows in order to enable threads ?
I don't think so because it should have
extends Thread
client->start()
client->join() to wait for thread exit if needed
such as this pthread example
possibily could you post a multi thread version of testwebsock.php please
I think that example is single threaded, and handles receive in process() for each user, round robin, I enclose an example where also the transmit in tick() is called round robin for each user with per client requested data from a mongo db in case you wish to make a similar multiple client example please
www.zip
The text was updated successfully, but these errors were encountered: