używam tego kodu...
https://github.com/socketio/socket.io/tree/...r/examples/chat jest on zrobiony w taki sposób że po wysłaniu wiadomości, wiadomość wraca do mnie... zastanawia mnie co zrobić aby wysłać wiadomość do socet 6
Jest tam kod:
protected function send($user, $message) {
if ($user->handshake) {
$message = $this->frame($message,$user);
$this->stdout("proba socket:". $user->socket); //Zwraca proba socket:Resource id #8
$othet_socket = "Resource id #8";
$other_socket = 8;// nie działa
$result = @socket_write
($othet_socket, $message, strlen($message)); }
else {
// User has not yet performed their handshake. Store for sending later.
$holdingMessage = array('user' => $user, 'message' => $message); $this->heldMessages[] = $holdingMessage;
}
}
Jak zmienię socketID to nikt nie dostaje natomiast $result = @socket_write($user->socket, $message, strlen($message)); wysyła tylko do mnie wiadomość... da się zrobić tak aby wysłać wiadomość na socket 8 ?