MCPcopy Index your code
hub / github.com/python/cpython / _data_received

Method _data_received

Lib/asyncio/proactor_events.py:251–274  ·  view source on GitHub ↗
(self, data, length)

Source from the content-addressed store, hash-verified

249 self.close()
250
251 def _data_received(self, data, length):
252 if self._paused:
253 # Don't call any protocol method while reading is paused.
254 # The protocol will be called on resume_reading().
255 assert self._pending_data_length == -1
256 self._pending_data_length = length
257 return
258
259 if length == 0:
260 self._eof_received()
261 return
262
263 if isinstance(self._protocol, protocols.BufferedProtocol):
264 try:
265 protocols._feed_data_to_buffered_proto(self._protocol, data)
266 except (SystemExit, KeyboardInterrupt):
267 raise
268 except BaseException as exc:
269 self._fatal_error(exc,
270 'Fatal error: protocol.buffer_updated() '
271 'call failed.')
272 return
273 else:
274 self._protocol.data_received(data)
275
276 def _loop_reading(self, fut=None):
277 length = -1

Callers 1

_loop_readingMethod · 0.95

Calls 3

_eof_receivedMethod · 0.95
_fatal_errorMethod · 0.45
data_receivedMethod · 0.45

Tested by

no test coverage detected