Thruway\Peer\Client::onMessage PHP Method

onMessage() public method

Handle process message
public onMessage ( Thruway\Transport\TransportInterface $transport, Thruway\Message\Message $msg )
$transport Thruway\Transport\TransportInterface
$msg Thruway\Message\Message
    public function onMessage(TransportInterface $transport, Message $msg)
    {
        Logger::debug($this, "Client onMessage: {$msg}");
        $session = $this->session;
        if ($msg instanceof WelcomeMessage) {
            $this->processWelcome($session, $msg);
        } elseif ($msg instanceof AbortMessage) {
            $this->processAbort($session, $msg);
        } elseif ($msg instanceof GoodbyeMessage) {
            $this->processGoodbye($session, $msg);
        } elseif ($msg instanceof ChallengeMessage) {
            $this->processChallenge($session, $msg);
        } else {
            $this->processOther($session, $msg);
        }
    }