MQL5 SocketConnect fails with error 4014 connecting to local TCP server
I’m developing an MQL5 Expert Advisor that should connect to a local TCP server (127.0.0.1:5001). The server is running and responds correctly to Telnet. In MetaTrader, I added 127.0.0.1:5001 in Options → Expert Advisors → Allow WebRequest for listed URLs. Firewall is disabled, and the port is free. My MQL5 code is: int socket; int OnInit() { socket = SocketCreate(); if(socket == INVALID_HANDLE) { Print("SocketCreate failed"); return(INIT_FAILED); } if(!SocketConnect(socket, "127.0.0.1", 5001)) { Print("SocketConnect failed with error: ", GetLastError()); return(INIT_FAILED); } Print("Connecte
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.