MCPcopy
hub / github.com/encode/uvicorn / data_received

Method data_received

uvicorn/protocols/websockets/wsproto_impl.py:147–155  ·  view source on GitHub ↗
(self, data: bytes)

Source from the content-addressed store, hash-verified

145 pass
146
147 def data_received(self, data: bytes) -> None:
148 try:
149 self.conn.receive_data(data)
150 except RemoteProtocolError as err:
151 # TODO: Remove `type: ignore` when wsproto fixes the type annotation.
152 self.transport.write(self.conn.send(err.event_hint)) # type: ignore[arg-type] # noqa: E501
153 self.transport.close()
154 else:
155 self.handle_events()
156
157 def handle_events(self) -> None:
158 for event in self.conn.events():

Callers

nothing calls this directly

Calls 4

handle_eventsMethod · 0.95
writeMethod · 0.45
sendMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected