Called when data first received

        :param data: Received data
        :param unique_id: Unique id
        :return: True if error present
196290
def _error_handler(data, unique_id):
        
        if data.get('statusCode') == 'FAILURE':
            logger.error('[Subscription: %s] %s: %s' % (unique_id, data.get('errorCode'), data.get('errorMessage')))
            if data.get('connectionClosed'):
                return True
        if data.get('status'):
            # Clients shouldn't disconnect if status 503 is returned; when the stream
            # recovers updates will be sent containing the latest data
            logger.warning('[Subscription: %s] status: %s' % (unique_id, data['status']))
1250183
def ensure_resource_data(self, update_data=False):
        
        # Check for unique identifier in the resource data
        if not any(key in self.data for key in self.UNIQUE_IDENTIFIERS):
            raise exceptions.HPOneViewMissingUniqueIdentifiers(MISSING_UNIQUE_IDENTIFIERS)

        # Returns if data update is not required
        if not update_data:
            return

        resource_data = None

        if 'uri' in self.UNIQUE_IDENTIFIERS and self.data.get('uri'):
            resource_data = self._helper.do_get(self.data['uri'])
        else:
            for identifier in self.UNIQUE_IDENTIFIERS:
                identifier_value = self.data.get(identifier)

                if identifier_value:
                    result = self.get_by(identifier, identifier_value)
                    if result and isinstance(result, list):
                        resource_data = result[0]
                        break

        if resource_data:
            self.data.update(resource_data)
        else:
            raise exceptions.HPOneViewResourceNotFound(RESOURCE_DOES_NOT_EXIST)
585854
protected boolean checkChannelId(final int id, final String svcType)
	{
		if (id == channelId)
			return true;
		logger.warn("received service " + svcType + " with wrong channel ID " + id + ", expected " + channelId
				+ " - ignored");
		return false;
	}
923613
def received(self, data):
        
        self.logger.debug('Data received: {}'.format(data))

        message_type = None

        if 'type' in data:
            message_type = data['type']

        if message_type == 'confirm_subscription':
            self._subscribed()
        elif message_type == 'reject_subscription':
            self._rejected()
        elif self.receive_callback is not None and 'message' in data:
            self.receive_callback(data['message'])
        else:
            self.logger.warning('Message type unknown. ({})'.format(message_type))
486643
def receive_message(self, message, data):
        
        if data['type'] == TYPE_RESPONSE_STATUS:
            self.is_launched = True
        return True
16586
def dataReceived(self, data):
        
        def write(result):
            print "Writing %r" % result
            self.transport.write(result)
        d = self.d()
        d.addCallback(write)  # errors are silently ignored!
        d.callback(data)
353602
def data_received(self, data):
        
        if self.state == STATE_STARTING:
            self.state = STATE_RUNNING
            _LOGGER.debug('Websocket handshake: %s', data.decode())
            return
        _LOGGER.debug('Websocket data: %s', data)

        while len(data) > 0:
            payload, extra_data = self.get_payload(data)
            self._data = payload ###
            self.async_session_handler_callback('data')###
            #self.async_callback(payload)
            data = extra_data
724039
public void onInitialDataDownloaded() {
        Log.d(TAG, "Initial Data Loaded");
        context().getContactsModule().startImport();
        if (appStateVM.isBookImported()) {
            onAppLoaded();
        }
    }
809054
def receive(self, data):
        
        self._incoming_segments_queue.put(data)
        if not self._in_handshake():
            self._flush_incoming_buffer()
1091512
def _on_io_events(self, fd=None, _events=None):
        
        if fd not in self._connections:
            LOGGER.warning('Received IO event for non-existing connection')
            return
        self._poll_connection(fd)
559011
def data_received(self, data):
        """"""
        data = data.decode()
        log.debug('received data: %s', data.strip())
        self.buffer += data
        self.handle_lines()
1285068
def received_response(self, value):
        
        if value == self._defaults['receivedResponse'] and 'receivedResponse' in self._values:
            del self._values['receivedResponse']
        else:
            self._values['receivedResponse'] = value
1081632
def _set_unique_id(self, json_response):
        
        self.unique_id = (
            json_response.get('md5')
            or json_response.get('sha1')
            or json_response.get('sha256')
            or ''
        )
557713
def data_received(self, data):
        
        self.time_out_handle.cancel()
        self.session.update(data.decode())

        if self.session.state == STATE_STARTING:
            self.transport.write(self.method.message.encode())
            self.time_out_handle = self.loop.call_later(
                TIME_OUT_LIMIT, self.time_out)

        elif self.session.state == STATE_PLAYING:
            self.callback(SIGNAL_PLAYING)

            if self.session.session_timeout != 0:
                interval = self.session.session_timeout - 5
                self.loop.call_later(interval, self.keep_alive)

        else:
            self.stop()
744533
async def _handle_data(self, data):
        
        try:
            _, _, verification_tag, chunks = parse_packet(data)
        except ValueError:
            return

        # is this an init?
        init_chunk = len([x for x in chunks if isinstance(x, InitChunk)])
        if init_chunk:
            assert len(chunks) == 1
            expected_tag = 0
        else:
            expected_tag = self._local_verification_tag

        # verify tag
        if verification_tag != expected_tag:
            self.__log_debug('Bad verification tag %d vs %d',
                             verification_tag, expected_tag)
            return

        # handle chunks
        for chunk in chunks:
            await self._receive_chunk(chunk)

        # send SACK if needed
        if self._sack_needed:
            await self._send_sack()
905529
function onRead( error, data ) {
		if ( error ) {
			return done( error );
		}
		data = parse( data, opts.reviver );
		if ( data instanceof Error ) {
			return done( data );
		}
		done( null, data );
	}
427589
def __on_connect(self, client, userdata, flags, result_code):
        # pylint: disable=W0613
        
        if result_code:
            # result_code != 0: something wrong happened
            _logger.error(
                "Error connecting the MQTT server: %s (%d)",
                paho.connack_string(result_code),
                result_code,
            )
        else:
            # Connection is OK: stop the reconnection timer
            self.__stop_timer()

        # Notify the caller, if any
        if self.on_connect is not None:
            try:
                self.on_connect(self, result_code)
            except Exception as ex:
                _logger.exception("Error notifying MQTT listener: %s", ex)