This repository has been archived by the owner on Sep 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking changes, UriHandlers are now managed by the ClientRouter. Be…
…tter PSR-2 compliance. Some changes to the examples
- Loading branch information
Showing
33 changed files
with
662 additions
and
1,458 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
File renamed without changes.
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Chris | ||
* Date: 30-9-13 | ||
* Time: 21:05 | ||
*/ | ||
|
||
require_once(__DIR__ . "/../vendor/autoload.php"); | ||
|
||
$loop = \React\EventLoop\Factory::create(); | ||
|
||
|
||
$logger = new \Zend\Log\Logger(); | ||
$writer = new Zend\Log\Writer\Stream("php://output"); | ||
$logger->addWriter($writer); | ||
|
||
$client = new \Devristo\Phpws\Client\WebSocket("ws://echo.websocket.org/?encoding=text", $loop, $logger); | ||
$client->on("connected", function($headers) use ($logger, $client){ | ||
$logger->notice("Connected!"); | ||
$client->send("Hello world!"); | ||
}); | ||
|
||
$client->on("message", function($message) use ($client, $logger){ | ||
$logger->notice("Got message: ".$message->getData()); | ||
$client->close(); | ||
}); | ||
|
||
|
||
$client->open(); | ||
$loop->run(); |
File renamed without changes.
Oops, something went wrong.