public function push($payload): void
    {
        // attach sender if not broadcast
        if (! $this->broadcast && $this->sender && ! $this->hasDescriptor($this->sender)) {
            $this->addDescriptor($this->sender);
        }

        // check if to broadcast to other clients
        if ($this->shouldBroadcast()) {
            $this->addDescriptors($this->getWebsocketConnections());
        }

        // push message to designated fds
        foreach ($this->descriptors as $descriptor) {
            if ($this->shouldPushToDescriptor($descriptor)) {
                $this->server->push($descriptor, $payload, $this->opcode);
            }
        }
    }
public function push($payload): void
    {
        // attach sender if not broadcast
        if (! $this->broadcast && $this->sender && ! $this->hasDescriptor($this->sender)) {
            $this->addDescriptor($this->sender);
        }

        // check if to broadcast to other clients
        if ($this->shouldBroadcast()) {
            $this->addDescriptors($this->getWebsocketConnections());
        }

        // push message to designated fds
        foreach ($this->descriptors as $descriptor) {
            if ($this->shouldPushToDescriptor($descriptor)) {
                $this->server->push($descriptor, $payload, $this->opcode);
            }
        }
    }
public function push ( $ payload ) : void { // attach sender if not broadcast if ( ! $ this -> broadcast && $ this -> sender && ! $ this -> hasDescriptor ( $ this -> sender ) ) { $ this -> addDescriptor ( $ this -> sender ) ; } // check if to broadcast to other clients if ( $ this -> shouldBroadcast ( ) ) { $ this -> addDescriptors ( $ this -> getWebsocketConnections ( ) ) ; } // push message to designated fds foreach ( $ this -> descriptors as $ descriptor ) { if ( $ this -> shouldPushToDescriptor ( $ descriptor ) ) { $ this -> server -> push ( $ descriptor , $ payload , $ this -> opcode ) ; } } }
Push message to related descriptors

@param mixed $payload

@return void
Push message to related descriptors