This commit is contained in:
Chris Boden 2012-04-25 20:50:07 -04:00
parent e06aa30096
commit 3908a69741
3 changed files with 6 additions and 5 deletions

View File

@ -39,9 +39,8 @@ WebSocketComponent wrapper if the servers recognize the protocol message framing
namespace MyApps; namespace MyApps;
use Ratchet\Component\MessageComponentInterface; use Ratchet\Component\MessageComponentInterface;
use Ratchet\Resource\ConnectionInterface; use Ratchet\Resource\ConnectionInterface;
use Ratchet\Resource\Socket\BSDSocket as Socket; use Ratchet\Component\Server\IOServerComponent;
use Ratchet\Component\Server\IOServerComponent as Server; use Ratchet\Component\WebSocket\WebSocketComponent;
use Ratchet\Component\WebSocket\WebSocketComponent as WebSocket;
use Ratchet\Resource\Command\Composite as Cmds; use Ratchet\Resource\Command\Composite as Cmds;
use Ratchet\Resource\Command\Action\SendMessage; use Ratchet\Resource\Command\Action\SendMessage;
use Ratchet\Resource\Command\Action\CloseConnection; use Ratchet\Resource\Command\Action\CloseConnection;
@ -84,8 +83,9 @@ class Chat implements MessageComponentInterface {
return new CloseConnection($conn); return new CloseConnection($conn);
} }
} }
// Run the server application through the WebSocket protocol // Run the server application through the WebSocket protocol
$server = new Server(new WebSocket(new Chat)); $server = new IOServerComponent(new WebSocketComponent(new Chat));
$server->run(80); $server->run(80);
``` ```

View File

@ -2,7 +2,8 @@
"name": "cboden/Ratchet" "name": "cboden/Ratchet"
, "type": "library" , "type": "library"
, "description": "PHP WebSocket server component library" , "description": "PHP WebSocket server component library"
, "keywords": ["WebSocket", "Server"] , "keywords": ["WebSockets", "Server", "Ratchet", "Sockets"]
, "website": "http://socketo.me"
, "repository": "https://github.com/cboden/Ratchet" , "repository": "https://github.com/cboden/Ratchet"
, "license": "MIT" , "license": "MIT"
, "authors": [ , "authors": [