public function hasActivity()
    {
        if (!$this->isConnected()) {
            return false;
        }
        $read = array($this->socket);
        $write = null;
        $ex = null;
        $result = socket_select($read, $write, $ex, 0, 0);
        if ($result === false) {
            throw new TcpException(
            	'Error selecting from socket: '
                . socket_strerror(socket_last_error($this->socket))
            );
        }
        return !empty($read);
    }