Comments (10)
fixed
from ll-mtproto.
you can't use time.sleep because it blocks the asyncio loop, you have to use its alternative "await asyncio.sleep"
from ll-mtproto.
same result even if we run rpc calls continuously without sleep.
this is because telegram limits the number of requests that can be made on a single mtproto connection, if it is exceeded you are blocked and have to reconnect.
from ll-mtproto.
from ll-mtproto.
LL-mtproto/ll_mtproto/network/mtproto.py
Line 340 in 45c79b9
from ll-mtproto.
yes
from ll-mtproto.
at high level only ConnectionResetError is given, at low level in the mtproto module the error is different based on what it is but this is only shown in the python logs in the error level.
from ll-mtproto.
LL-mtproto/ll_mtproto/client.py
Line 263 in 2aff4ed
from ll-mtproto.
while True:
dialogs = await session.rpc_call(
{
"_cons": "messages.getDialogs",
"flags": 1,
"hash": 0,
"offset_peer": {"_cons": "inputPeerEmpty"},
"offset_id": 0,
"offset_date": 0,
"offset": 0,
"max_id": 0,
"limit": 100,
})
#print(dialogs)
await asyncio.sleep(5)
can you check above code?
DEBUG:root:disconnected from Telegram
DEBUG:root:disconnected from Telegram
DEBUG:root:connecting to Telegram at 149.154.167.91:443
DEBUG:root:sending message (invokeWithLayer) 7098948223390284988 to mtproto
DEBUG:root:sending message (get_future_salts) 7098948223406214400 to mtproto
DEBUG:root:sending message (updates.getState) 7098948223416016168 to mtproto
DEBUG:root:sending message (messages.getDialogs) 7098948223428451984 to mtproto
DEBUG:root:received message (rpc_result) 7098948223410395137 from mtproto
DEBUG:root:sending message (msgs_ack) 7098948223442698004 to mtproto
DEBUG:root:received message (future_salts) 7098948223416303617 from mtproto
DEBUG:root:scheduling get_future_salts, current salt is valid for 1801 seconds
DEBUG:root:received message (msg_container) 7098948223452849153 from mtproto
DEBUG:root:sending message (msgs_ack) 7098948223475808032 to mtproto
DEBUG:root:received message (rpc_result) 7098948223861139457 from mtproto
DEBUG:root:sending message (msgs_ack) 7098948223914742824 to mtproto
DEBUG:root:sending message (messages.getDialogs) 7098948245422259164 to mtproto
DEBUG:root:received message (rpc_result) 7098948245962530817 from mtproto
DEBUG:root:sending message (msgs_ack) 7098948246007004280 to mtproto
DEBUG:root:disconnected from Telegram
DEBUG:root:disconnected from Telegram
DEBUG:root:connecting to Telegram at 149.154.167.91:443
DEBUG:root:sending message (invokeWithLayer) 7098948267493938284 to mtproto
DEBUG:root:sending message (get_future_salts) 7098948267514313972 to mtproto
DEBUG:root:sending message (updates.getState) 7098948267521636800 to mtproto
DEBUG:root:sending message (messages.getDialogs) 7098948267527355804 to mtproto
DEBUG:root:received message (msg_container) 7098948267522002945 from mtproto
DEBUG:root:scheduling get_future_salts, current salt is valid for 1801 seconds
DEBUG:root:received message (msg_container) 7098948267900705793 from mtproto
DEBUG:root:sending message (msgs_ack) 7098948267926026220 to mtproto
DEBUG:root:received message (rpc_result) 7098948268031158273 from mtproto
DEBUG:root:sending message (msgs_ack) 7098948268055064720 to mtproto
DEBUG:root:received message (rpc_result) 7098948268239378433 from mtproto
DEBUG:root:sending message (msgs_ack) 7098948268287761780 to mtproto
can clearly know connection is dying in 10 seconds.
from ll-mtproto.
thanks @andrew-ld
from ll-mtproto.
Related Issues (9)
- how to use this library? HOT 12
- crypto providers
- Unknown constructor 0x1cb5c415 HOT 3
- layer 140 HOT 4
- multithread async deserialize HOT 12
- response to json HOT 10
- received a message with unknown salt! HOT 24
- implement queue based mtproto messages write HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ll-mtproto.