Open GoogleCodeExporter opened 9 years ago
[deleted comment]
[deleted comment]
You can add a sendAll function that loops through the users array and sends a
write
to each socket in the array. The following is a quick way to do that:
function sendAll($msg){
global $users;
$msg = wrap($msg);
foreach ($users as $eachUser) {
socket_write($eachUser->socket,$msg,strlen($msg));
say("User ".$eachUser->id." > ".$msg);
}
}
EDIT: Fixed typo
Original comment by kryptyx
on 30 Apr 2010 at 4:03
I have done some coding. I have modified the code so that multiple client can
run at the same time. each send and receive msg at the same time.
Here is the code - http://vgsr.posterous.com/group-chat-via-phpwebsocket
My email id = narendra@narendrasisodiya.com Can I comit the changes ?
Original comment by narendra.sisodiya
on 10 Jul 2010 at 4:15
Original issue reported on code.google.com by
shivam0...@gmail.com
on 13 Mar 2010 at 1:26