Comments (8)
My Login Function
async def login(self, attempts=5):
print('IN [login]')
check, reason = await self.client.connect()
if check:
print(datetime.now(), " Successfully reconnected!!!")
else:
print(datetime.now(), "Failed to connect")
attempt = 1
print(colored("[INFO]: ", "blue"), "Connecting...")
while attempt <= attempts:
if not self.client.check_connect():
print(colored("[INFO]: ", "blue"), f"Trying to reconnect, try {attempt} for {attempts}")
check, reason = await self.client.connect()
if check:
print(datetime.now(), " Successfully reconnected!!!")
break
print(colored("[INFO]: ", "blue"), "Error reconnecting", reason)
attempt += 1
if os.path.isfile(".session.json"):
os.remove(".session.json")
elif not check:
attempt += 1
else:
break
await asyncio.sleep(0.5)
print('OUT login')
return check, reason
Modified on_close function of quotexpy.ws.client
def on_close(self, wss, close_status_code, close_msg):
logger.debug("IN [on_close] function")
"""Method to process websocket close."""
logger.info("Websocket connection closed.")
print(datetime.now(), " Close Reason: ",close_status_code, close_msg)
global_value.check_websocket_if_connect = 0
logger.debug("OUT [on_close] function")
I found that after some time on_close is getting called automatically, how can I prevent that? also it is showing close_status_code
and close_msg
as None that's why I am kind of unable to figure out cause of auto close endpoint :(
from quotexpy.
I uploaded the latest version implementing the singleton design pattern for single connections. Can you confirm if the problem continues to occur?
from quotexpy.
Can you please tell me how I can take advantage of your singleton pattern, I cannot find it.
from quotexpy.
from quotexpy.
![Screenshot 2023-12-26 at 9 38 34 PM](https://private-user-images.githubusercontent.com/118208838/292892836-d785d3d9-ab74-43b4-a751-cf50eba38cf8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NDcwNzYsIm5iZiI6MTcyMzc0Njc3NiwicGF0aCI6Ii8xMTgyMDg4MzgvMjkyODkyODM2LWQ3ODVkM2Q5LWFiNzQtNDNiNC1hNzUxLWNmNTBlYmEzOGNmOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgxNVQxODMyNTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01MjJkZDc0MWE2OTBmMDcwNTY5NDkzNmUwY2Q5NDY3YmI5YTczNTQ5MjczNmY3Mjk4YzMzYzdjYmU5ZDg4MGRjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9._tIIUbrY9RfYsVq34WnAT8I57ABYmegJFqWlw074wik)
from quotexpy.
I have found that the connection is being closed due to "pingInterval":25000
,
To fix this I have created a thread(in quotexpy.ws.client.on_open function) that will ping after every pingInterval time to keep the connection alive and I am sending random messages since I don't know any smaller messages which I can use to keep the connection alive with minimum network IO
Here is message I am sending each ping interval to keep the connection alive
self.wss.send('42["instruments/update",{"asset":"EURUSD","period":60}]')
I feel it is not a right message that can be used to ping was to keep alive please suggest to me right solution for it,
Please throw some light If I am doing anything wrong here
from quotexpy.
monitoring the socket, the ping time is actually at 25000, but the response on_pong is sending is the value "2"
from quotexpy.
This issue is stale because it has been open for 30 days with no activity.
from quotexpy.
Related Issues (20)
- The asset isn't executed at times HOT 2
- Results not updating after trade executed HOT 2
- ModuleNotFoundError: No module named 'quotexpy.ws.channels' HOT 2
- Getting Handshake status 403 Forbidden error HOT 8
- I'm getting item not price error when placing a trade for a OTC symbol
- cloudflare is blocking playwright could not connect HOT 12
- Can you tell me about setup HOT 2
- Change Currencies on the fly HOT 3
- samee issue of 403 ,, whyy,, tried everything!!! HOT 2
- when installing quotexpy HOT 5
- ¿Is it possible to obtain the trade history? HOT 5
- SSID took too long to respond? HOT 3
- santii, sir,,, can we trade in multiple accounts simultaneously? HOT 23
- I want a collaborator for a step-ahead project, with the help of santii,sir's module,, anybody wants to ? HOT 2
- santii, sir,,, im trying to trade for an hour , but after every trade the WS is closed, and the connection is needed to be establised again,, please can you help me with that? HOT 1
- All values of candle are None. HOT 19
- Issue in get_cokkies_and_ssid HOT 13
- Hey
- Help HOT 1
- Non-OTC pairs not placing bets.
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 quotexpy.