Skip to main content

All Questions

1 vote
0 answers
53 views

Asyncio.ws_connect not receiving a connection closure message

async def _connect_session(self): websocket_url, headers, cookies = self._get_connect_data() try: async with aiohttp.ClientSession(cookies=cookies) as session: logger.debug(...
Vladimir Vasiliev's user avatar
0 votes
1 answer
75 views

Aiohttp / blocking send_str method

I have a little understanding problem with asyncio and aiohttp. Looking at my code, I would expect the following: Asyncio gather() starts with funk1 first. The "a" is printed and the buy ...
Remember's user avatar
3 votes
1 answer
2k views

"async with" within asyncio.Task not working

I am learning python asyncio and testing a lot of code using them. Below is a code where I try to subscribe multiple Websocket streaming using asyncio and aiohttp. I do not understand why when coro(...
koyamashinji's user avatar
0 votes
1 answer
1k views

multiple Websocket streaming with asyncio/aiohttp

I am trying to subscribe to multiple Websocket streaming using python's asyncio and aiohttp. When I run the below code, it only prints "a" but nothing else in the console as output. It does ...
koyamashinji's user avatar
3 votes
1 answer
3k views

Why does asyncio.CancelledError need to be re-raised?

I have the following aiohttp WebSocket handler: async def websocket_handler(request): ws = None if 'my-websocket-clients' not in request.app: request.app['my-websocket-clients'] = [] ...
Daniel F's user avatar
  • 14.3k
0 votes
1 answer
419 views

How to connect with multiply websockets using Jupyter notebook

This program on Jupyter notebook connect only with first websocket. What is wrong? session1 = aiohttp.ClientSession() session2 = aiohttp.ClientSession() async with session1.ws_connect('host1') as ...
kigudesm's user avatar
0 votes
0 answers
414 views

Aiohttp websocket

I am trying to build a connection using AIOHTTP where from client-side I will get multiple requests continuously. So at the server-side, I have to create WebSocket connection using AIOHTTP so that I ...
Harshit's user avatar
0 votes
0 answers
712 views

how to send the websocket message outside the corouture request

I stablish the coroutine WebSocket link, but only can send a message inside this coroutine, my question is how to send a message outside this coroutine with current client #!/usr/bin/env python3 ...
Hamid s k's user avatar
  • 248
2 votes
1 answer
781 views

aiohttp and asyncio how to get response from http request and websocket in concurrent way?

I try to receive data from two endpoints in same time. But if websocket stop to send messages I won't receive data from request from "https://www.blabla.com". What is the best way for solving this ...
ChzChz's user avatar
  • 67
2 votes
1 answer
1k views

python aiohttp websockets closed browser tab handling

I am trying to create simple active users counter using aiohttp WebSockets and aioredis for storage. When I add a new tab in Google Chrome, my counter increments perfectly in all already opened tabs. ...
Alexandr Tatarinov's user avatar
2 votes
1 answer
540 views

aiohttp - how can I view the websocket msg buffer?

Unfortunately the documentation for this library is rather limited and I can find allusions to the websocket message buffer but no method to access it. Does anyone know a way I can see the messages ...
jsstuball's user avatar
  • 4,971
2 votes
0 answers
634 views

Python: Trouble with Asyncio/Aiohttp Websocket client requests

Been trying to extract websocket information from Bitfinex websocket client service. Below is the code. The script works fine when I search for under 30 crypto pairs (ie. "p" or "PAIRS" has 30 ...
pipinstallme's user avatar
2 votes
1 answer
2k views

autoreconnect for aiohttp websocket

I am writing an app listening to websocket connections and making infrequent REST requests. aiohttp seems like a natural choice for this, but I'm flexible. The app is simple but needs to be reliable (...
jam123's user avatar
  • 129
2 votes
1 answer
318 views

aiohttp websocket EOfStream handling

I'm connecting to a websocket endpoint using aiohttp's default WebsocketProtocol and out of the blue (after some time and multiple infinite loop iterations) I always get WSMsgType.ERROR with EofStream ...
Exa's user avatar
  • 181
1 vote
1 answer
469 views

How to display value from asyncio in web browser page using WebSocket

I'm new to asyncio and aiohttp as well as WebSockets. Basically, I need to generate a random string, change it every second and display its value on the web page without refreshing. I wrote the ...
Alex Ermolaev's user avatar

15 30 50 per page