(self)
| 278 | |
| 279 | @asyncio.coroutine |
| 280 | def receive_bytes(self): |
| 281 | msg = yield from self.receive() |
| 282 | if msg.tp != MsgType.binary: |
| 283 | raise TypeError( |
| 284 | "Received message {}:{!r} is not bytes".format(msg.tp, |
| 285 | msg.data)) |
| 286 | return msg.data |
| 287 | |
| 288 | def write(self, data): |
| 289 | raise RuntimeError("Cannot call .write() for websocket") |