for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Async sockets
*
* @copyright Copyright (c) 2015-2016, Efimov Evgenij <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace AsyncSockets\Socket\Io;
* Class Context
class Context
{
* Unread data in socket
* @var string[]
private $unreadData = ['', ''];
* Return UnreadData
* @param bool $isOutOfBand Flag if it is out of band data
* @return string
public function getUnreadData($isOutOfBand = false)
return $this->unreadData[(int) (bool) $isOutOfBand];
}
* Sets UnreadData
* @param string $unreadData New value for UnreadData
* @return void
public function setUnreadData($unreadData, $isOutOfBand = false)
$this->unreadData[(int) (bool) $isOutOfBand] = $unreadData;
* Resets socket context
public function reset()
$this->unreadData = ['', ''];