PageRenderTime 73ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/wsuser.class.php

http://github.com/jam1401/PHP-Websockets-Server
PHP | 69 lines | 49 code | 16 blank | 4 comment | 0 complexity | ff6c7260360dc9fceef23367307a5725 MD5 | raw file
  1. <?php
  2. require_once 'wsuser.class.php';
  3. require_once 'handshaker.interface.php';
  4. require_once "wsprotocol.interface.php";
  5. class WsUser {
  6. private $id;
  7. private $socket;
  8. private $handshake_done = false;
  9. private $transcoder;
  10. private $appId;
  11. private $protocol;
  12. /**
  13. * Class Constructor for the WsUser Object
  14. *
  15. */
  16. function WsUser() {
  17. $this->id = uniqid();
  18. }
  19. function id() {
  20. return $this->id;
  21. }
  22. function setSocket($socket) {
  23. $this->socket = $socket;
  24. }
  25. function socket() {
  26. return $this->socket;
  27. }
  28. function setHandshakeDone() {
  29. $this->handshake_done = true;
  30. }
  31. function handshakeDone() {
  32. return $this->handshake_done;
  33. }
  34. function setTranscoder(MessageTranscoder $transcoder) {
  35. $this->transcoder = $transcoder;
  36. }
  37. function transcoder() {
  38. return $this->transcoder;
  39. }
  40. function setProtocol(WSProtocol $protocol) {
  41. $this->protocol = $protocol;
  42. }
  43. function protocol() {
  44. return $this->protocol;
  45. }
  46. function setAppID($app) {
  47. $this->appId = $app;
  48. }
  49. function appId() {
  50. return $this->appId;
  51. }
  52. }
  53. ?>