protected $magicGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
function Transport_websocket($secure = FALSE) {
+ $this->type = ($secure == FALSE ? "websocket" : "websocketsec");
$this->headerOriginRequired = false;
$this->headerSecWebSocketProtocolRequired = false;
$this->headerSecWebSocketExtensionsRequired = false;
$this->sendingContinuous = false;
- $this->sendingContinuous = false;
- $this->partialMessage = "";
- $this->hasSentClose = false;
+ $this->handlingPartialPacket = false;
+ $this->partialMessage = "";
+
+ $this->hasSentClose = false;
}
protected function extractHeaders($message) {
return $strout . "\n";
}
+ function unchunk($cont)
+ {
+ // fprintf(STDERR, "CHUNK: [%s]\n", $cont);
+ return $this->deframe($cont);
+ }
+
function chunk($step, $cont)
{
// fprintf(STDERR, "CHUNK: [%s]\n", $cont);
class Transport_xhr {
function Transport_xhr() {
+ $this->type = 'xhr';
}
function init($enc, $header, &$header_out, $init_string, $base, $step)
class Transport_iframe {
function Transport_iframe() {
+ $this->type = 'iframe';
}
function init($enc, $header, &$header_out, $init_string, $base, $step)
}
class Transport_htmlfile extends Transport_iframe {
+ function Transport_htmlfile() {
+ $this->type = 'htmlfile';
+ }
}
class Transport {
static function create($transp)
{
- if ($transp == 'websocket') {
- return new Transport_websocket();
+ if ($transp == 'websocket' || $transp == 'websocketsec') {
+ return new Transport_websocket($transp == 'websocketsec');
}
else if ($transp == 'xhr') {
return new Transport_xhr();
}
}
}
-?>
\ No newline at end of file
+?>