Skip to content
This repository has been archived by the owner on Mar 6, 2019. It is now read-only.

Commit

Permalink
Exception fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CupOfTea696 committed Apr 19, 2015
1 parent be51d7a commit ac5efa3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Exception/InvalidRecipientException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php namespace CupOfTea\TwoStream\Exception;

use Exception;

class InvalidRecipientException extends exception
{
public function __construct($recipient){
parent::__construct('Invalid recipient: ' . $recipient, );
}
}
3 changes: 2 additions & 1 deletion src/Server/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Http\Request;

use CupOfTea\TwoStream\Session\ReadOnly;
use CupOfTea\TwoStream\Exception\InvalidRecipientException;

use Ratchet\ConnectionInterface as Connection;
use Ratchet\Wamp\WampServerInterface as DispatcherContract;
Expand Down Expand Up @@ -122,7 +123,7 @@ protected function send($response, Connection $connection, $topic){

if($recipient == 'all'){
$topic->broadcast($data);
}elseif($recipient == 'except'){
}elseif($recipient == 'Exceptionsept'){
foreach($topic->getIterator() as $client){
if($client->Session->getId() != $connection->Session->getId())
$client->event($topic->getId(), $data);
Expand Down

0 comments on commit ac5efa3

Please sign in to comment.