iqoptionapi
iqoptionapi copied to clipboard
api.buy, api.getcandles and api.profile.balance produces WebSocketConnectionClosedException
I was trying to use the api and really i getting it, it works greatly but i have only one trouble, after some time of use api.getcandles
or api.profile.balance
or api.buy
it is produced an exception in websocket
this is the exception:
File "C:\Python\lib\site-packages\websocket\_socket.py", line 113, in send
raise WebSocketConnectionClosedException("socket is already closed.")
websocket._exceptions.WebSocketConnectionClosedException: socket is already closed.
I was trying to handle it with try-except and recovery the connection but i can't if i try to use the api.connect method after the exception looks like it is connected but if i use any function return the same exception, so how to reconnect the api after an exception like this