Created
April 24, 2014 20:52
-
-
Save dwolfhub/11269116 to your computer and use it in GitHub Desktop.
Chatter MessageComponentInterface implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Chatter; | |
use Ratchet\MessageComponentInterface; | |
use Ratchet\ConnectionInterface; | |
class Chatter implements MessageComponentInterface { | |
/** | |
* When connection is opened | |
* | |
* @param ConnectionInterface $conn | |
* @return Void | |
*/ | |
public function onOpen(ConnectionInterface $conn) {} | |
/** | |
* When message is received | |
* | |
* @param ConnectionInterface $from | |
* @param String $msg | |
* @return Void | |
*/ | |
public function onMessage(ConnectionInterface $from, $msg) {} | |
/** | |
* When connection is closed | |
* | |
* @param ConnectionInterface $conn | |
* @return Void | |
*/ | |
public function onClose(ConnectionInterface $conn) {} | |
/** | |
* When a connection error occurs | |
* | |
* @param ConnectionInterface $conn | |
* @param Exception $e | |
* @return Void | |
*/ | |
public function onError(ConnectionInterface $conn, \Exception $e) {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment