mxmbsocket/lib/Ratchet/Protocol/WebSocket/Client.php
Chris Boden 2d7774fd65 Hixie-76 protocol
Implemented WebSocket Hixie-76 protocol
2011-11-01 14:10:12 -04:00

51 lines
1.0 KiB
PHP

<?php
namespace Ratchet\Protocol\WebSocket;
use Ratchet\Protocol\WebSocket\Version\VersionInterface;
/**
* A representation of a Socket connection of the user on the other end of the socket
*/
class Client {
/**
* @var Ratchet\Protocol\WebSocket\Version\VersionInterface
*/
protected $_version = null;
/**
* @var bool
*/
protected $_hands_shook = false;
/**
* @param Version\VersionInterface
* @return Client
*/
public function setVersion(VersionInterface $version) {
$this->_version = $version;
return $this;
}
/**
* @return Version\VersionInterface
*/
public function getVersion() {
return $this->_version;
}
/**
* @param string
* @return array|string
*/
public function doHandshake($headers) {
$this->_hands_shook = true;
return $this->_version->handshake($headers);
}
/**
* @return bool
*/
public function isHandshakeComplete() {
return $this->_hands_shook;
}
}