vdemydiuk / mtapi

MetaTrader API (terminal bridge)
http://mtapi4.net/
MIT License
511 stars 276 forks source link

Unhandled Exception - CommunicationException: Client is not connected #255

Open matteuccimarco opened 3 years ago

matteuccimarco commented 3 years ago

Hello,

yesterday i installed the MTApi in three VPS and i run a little software that implement your MTApi. It just connects itself to a MT4 terminal and check the Balance and the account number, all the day.

I log the activities of MTApi message using your PrintLog routine with an additional writefile to check what happened in the past hours.

About at the same moment, in all three VPSs, i got a .NET Unhandled exception and i think it could be in a referenced dll because uses a paste of your routines inside the examples to get the messages from MT4 Terminal.

Analysing the log, i saw that during the day i get some ConnectionException with message "Client is not connected" and this exceptions are correctly managed by your API and i write them into my log file.

BUT, this time it seems that the same error "Client is not connected" raise an unhandled exception but i don't know how to proceed and i would like to ask you if you can give any suggestions or, better, an help.

Here the text message of the .NET Exception and the screenshot of the messagebox i got.

Thank you very much! unhandled exception client is not connected log.txt

TheSnowGuru commented 3 years ago

Hey, did you check this solution? https://github.com/TheSnowGuru/PyTrader-python-mt4-mt5-trading-api-connector-drag-n-drop