Net/Notifier/Sender.php
public function send($action, array $data = array())
    {
        $message = array('action' => $action);

        if (count($data) > 0) {
            $message['data'] = $data;
        }

        $message = json_encode($message);

        $this->connect();
        $this->connection->writeText($message);
        $this->disconnect();

        return $this;
    }
public function send($action, array $data = array())
    {
        $message = array('action' => $action);

        if (count($data) > 0) {
            $message['data'] = $data;
        }

        $message = json_encode($message);

        $this->connect();
        $this->connection->writeText($message);
        $this->disconnect();

        return $this;
    }
public function send ( $ action , array $ data = array ( ) ) { $ message = array ( 'action' => $ action ) ; if ( count ( $ data ) > 0 ) { $ message [ 'data' ] = $ data ; } $ message = json_encode ( $ message ) ; $ this -> connect ( ) ; $ this -> connection -> writeText ( $ message ) ; $ this -> disconnect ( ) ; return $ this ; }
Connects to the WebSocket server, sends a text message and disconnects

@param string $action the notification action.
@param array  $data   optional. The notification data.

@return Net_Notifier_Sender the current object, for fluent interface.

@throws Net_Notifier_ClientException if there is an error connecting
to the notification server or sending the message.
Connects to the WebSocket server sends a text message and disconnects