Skip to content

Commit

Permalink
Seems legit...
Browse files Browse the repository at this point in the history
  • Loading branch information
ghedipunk committed Sep 6, 2018
1 parent 70599d6 commit df955ff
Show file tree
Hide file tree
Showing 11 changed files with 409 additions and 0 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions .idea/PHP-Websockets.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

325 changes: 325 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions testwebsock.php
Expand Up @@ -4,6 +4,12 @@
require_once('./websockets.php');

class echoServer extends WebSocketServer {

function __construct($addr, $port, $bufferLength) {
parent::__construct($addr, $port, $bufferLength);
$this->userClass = 'MyUser';
}

//protected $maxBufferSize = 1048576; //1MB... overkill for an echo server, but potentially plausible for other applications.

protected function process ($user, $message) {
Expand Down
9 changes: 9 additions & 0 deletions users.php
Expand Up @@ -19,4 +19,13 @@ function __construct($id, $socket) {
$this->id = $id;
$this->socket = $socket;
}
}

class MyUser extends WebSocketUser {
public $myId;

function __construct($id, $socket, $myId) {
parent::__construct($id, $socket);
$this->myId = $myId;
}
}

0 comments on commit df955ff

Please sign in to comment.