Lu-Yi-Hsun / iqoptionapi

IQ Option API
372 stars 289 forks source link

Socket failed with ssl.SSLEOFError on login call #109

Open milseg opened 5 years ago

milseg commented 5 years ago

I was running version 3,8,1 commit and then this error succeeded. There was no apparent reason for the failure. It would be nice to add a try/except clause in the library to prevent the exception to be raised

Stack trace is bellow:

Traceback (most recent call last): File "TopMac.py", line 384, in I_want_money=IQ_Option(email,senha) File "C:\ProgramData\Anaconda3\lib\site-packages\iqoptionapi\stable_api.py", line 40, in init self.connect() File "C:\ProgramData\Anaconda3\lib\site-packages\iqoptionapi\stable_api.py", line 88, in connect self.api.setOptions(1,True) File "C:\ProgramData\Anaconda3\lib\site-packages\iqoptionapi\api.py", line 427, in setOptions self.websocket.send(data) File "C:\ProgramData\Anaconda3\lib\site-packages\websocket_app.py", line 147, in send if not self.sock or self.sock.send(data, opcode) == 0: File "C:\ProgramData\Anaconda3\lib\site-packages\websocket_core.py", line 240, in send return self.send_frame(frame) File "C:\ProgramData\Anaconda3\lib\site-packages\websocket_core.py", line 265, in send_frame l = self._send(data) File "C:\ProgramData\Anaconda3\lib\site-packages\websocket_core.py", line 430, in _send return send(self.sock, data) File "C:\ProgramData\Anaconda3\lib\site-packages\websocket_socket.py", line 117, in send return sock.send(data) File "C:\ProgramData\Anaconda3\lib\ssl.py", line 984, in send return self._sslobj.write(data) ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2324)

phucdt178 commented 5 years ago

Hello,

I have the same issue but with version 3.9.2. I added the try catch but it randomly failed.

Sometimes I can run in many hours without any error but sometimes not.

JafferWilson commented 5 years ago

Please let us know what is the version of your websocket?

phucdt178 commented 5 years ago

I'm using this version websocket_client-0.47.0.

Which version is better for iqoption 3.9.2 ?

milseg commented 5 years ago

@JafferWilson mine is 0.47.0

milseg commented 5 years ago

@phucdt178 According to the readme is 0.47.0 itself

JafferWilson commented 5 years ago

@milseg I would recommend you to re-install the API. It will certainly resolve your issues. Still, if not then you must check the login credentials on your browser, what you are supplying to the API.

Lu-Yi-Hsun commented 5 years ago

@milseg @JafferWilson @phucdt178

try the last version iqoptionapi base websocket-client==0.56 version

i think it can fix

Lu-Yi-Hsun commented 4 years ago

@milseg @phucdt178 @JafferWilson That have been fix in private version. i find the main problem, can test for long time.