Download MetaTrader 5
To add comments, please log in or register
Launch your trading signal. Make profit from paid subscription!
Carl Schreiber
5947
Carl Schreiber 2014.06.12 09:19 

Hi,

I am trying to connect the mt4 as a Socket-Client to a waiting Socket-Serve: I can see the Socket-Server waiting for connection in Windows SysInternalsSuits\TCPView.

I am using the example from here: https://www.mql5.com/en/code/9296.

I found that several things have to be changed as the types don't fit:

        // changes in WinSock.mqh
        //org: int gethostbyaddr(string addr, int len, int type);
        int gethostbyaddr(char& addr[], int len, int type); // new: char& addr[] instead of string addr
        //org: int inet_addr(string addr);
        char inet_addr(string addr); // new type:char
        // I replaced all struct into arr as the new mt4 gets confused :(

In wsockclnt.mq4 I changed:

char addr[1]; // in stead of int addr[1];
..
// and here again all struct to arr e.g.: int2struct => int2arr

The client does not connect but has this messages:

2014.06.12 11:13:38.478 wsockclnt EURUSD.fx,M1: Client: connect() failed: 10049
2014.06.12 11:13:38.478 wsockclnt EURUSD.fx,M1: Client: Client connecting to: 127.0.0.1 => conn_socket:1148
2014.06.12 11:13:38.478 wsockclnt EURUSD.fx,M1: Client: socket() is OK.
2014.06.12 11:13:38.478 wsockclnt EURUSD.fx,M1: server addr:0 hp6061000
2014.06.12 11:13:38.478 wsockclnt EURUSD.fx,M1: Client: WSAStartup() is OK.

Error 10049 means: WSAEADDRNOTAVAIL Cannot assign requested address.

So what can I do?

The Socket-server is up and waitung for connection I can see it in TCPView - from that side everything seem to be perfect - MT4 fails again ??

Gooly

Kyp
3
Kyp 2014.10.06 18:58  
gooly:

Hi,

I am trying to connect the mt4 as a Socket-Client to a waiting Socket-Serve: I can see the Socket-Server waiting for connection in Windows SysInternalsSuits\TCPView.

I am using the example from here: https://www.mql5.com/en/code/9296.

I found that several things have to be changed as the types don't fit:

In wsockclnt.mq4 I changed:

The client does not connect but has this messages:

So what can I do?

The Socket-server is up and waitung for connection I can see it in TCPView - from that side everything seem to be perfect - MT4 fails again ??

Gooly



Any luck with the issue you had?  I have the same problem. Please let me know if you managed to resolve it.
Thanks

Carl Schreiber
5947
Carl Schreiber 2014.10.06 19:47  
I finally used files :(
/
To add comments, please log in or register