MCPcopy
hub / github.com/encode/starlette / receive_bytes

Method receive_bytes

starlette/websockets.py:123–128  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

121 return cast(str, message["text"])
122
123 async def receive_bytes(self) -> bytes:
124 if self.application_state != WebSocketState.CONNECTED:
125 raise RuntimeError('WebSocket is not connected. Need to call "accept" first.')
126 message = await self.receive()
127 self._raise_on_disconnect(message)
128 return cast(bytes, message["bytes"])
129
130 async def receive_json(self, mode: str = "text") -> Any:
131 if mode not in {"text", "binary"}:

Callers 6

iter_bytesMethod · 0.95
appFunction · 0.95

Calls 2

receiveMethod · 0.95
_raise_on_disconnectMethod · 0.95