This repository has been archived by the owner on Oct 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Handle_websocket_request method in JsonRpc class #59
Labels
Comments
Sounds reasonable. Do you have a patch for this? |
@fscherf i overridden this function to something like this class MyJsonRpc(JsonRpc):
def __init__(self):
super().__init__()
async def handle_websocket_request(self, http_request):
http_request.msg_id = 0
http_request.pending = {}
# prepare and register websocket
ws = aiohttp.web_ws.WebSocketResponse(max_msg_size=int(1e+12))
await ws.prepare(http_request)
http_request.ws = ws
self.clients.append(http_request)
while not ws.closed:
self.logger.debug('waiting for messages')
raw_msg = await ws.receive()
if not raw_msg.type == aiohttp.WSMsgType.TEXT:
continue
self.logger.debug('raw msg received: %s', raw_msg.data)
self.loop.create_task(self._handle_rpc_msg(http_request, raw_msg))
self.clients.remove(http_request)
return ws |
@Noor-Kalibbala ws = aiohttp.web_ws.WebSocketResponse(max_msg_size=int(1e+12)) right? Where does |
@fscherf Actually its equivalent to one terabyte but I think u can set it to zero to
ignore message size may be
…On Tue, Oct 20, 2020, 6:09 PM Florian Scherf ***@***.***> wrote:
@Noor-Kalibbala <https://github.com/Noor-Kalibbala>
The only line that is changed is
ws = aiohttp.web_ws.WebSocketResponse(max_msg_size=int(1e+12))
right? Where comes int(1e+12) from?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#59 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM3YELKWCUBCHM2CNTRXQL3SLWR4LANCNFSM4SULAESA>
.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Incase the user have big json data, the future will just through timeout error instead
Of informing that user that actually the message size is exceeded, it would be
Nice if the Web socket response class can be supplied with max_msg_size incse the user wants to adjust that size.
The text was updated successfully, but these errors were encountered: