Download MetaTrader 5

Libraries: TCP socket

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
192496
MetaQuotes Software Corp.  

TCP socket :

placed utility functions from ryaz's server socket into socket.mqh, makes it really easy to use. comes with similar server example.

Author: seth

seth
20
seth  
So, this was sort of a quick start for me, easiest thing to do to use someone elses code. However, right now im looking at using http://www.zeromq.org/, an asynchronous library which actually makes sense - simple functions to open connection, accept, receive, close, etc!. Just throwing that out there, i know that ive heard people wanting asynchronous before.
seth
20
seth  

better library using zeromq here

http://codebase.mql4.com/en/code/9991

Do Hung
151
Do Hung  

Hi Starry,

It took me a week to study and try to setup.

1. With wsockserv

  • wsockserv EURUSD,H1: Server: listening and waiting connection port:7779, protocol:TCP
  • wsockserv EURUSD,H1: Server: listen() is OK.
  • wsockserv EURUSD,H1: Server: bind() is OK
  • .....

2. With wsockclnt 

  • wsockclnt EURUSD,H1: Client: recv() failed: error 10054
  • wsockclnt EURUSD,H1: Client: Sent data This is a test message from client _ Hello 0
  • wsockclnt EURUSD,H1: Client: send() is OK.
  • wsockclnt EURUSD,H1: Client: connect() is OK.
  • wsockclnt EURUSD,H1: Client: Client connecting to: xxx.xxx.xxx.xxx ( IP)
  • .....

That means, Server is waiting and Client is sent msg. But I dont know why it can not communicate with together.

Please support if someone know about this.

Thank you very much for your support. 

Do Hung
151
Do Hung  

What is the best solution to connect 2 PC over Internet with MT4 to send signal to each other?

Thanks! 

sunshineh
1258
sunshineh  
Is this project working with MT > Build 600??
scotttiger
5
scotttiger  

Guys the sources are working but still trying to migrate this to MT5 currently:

I am currently trying to make it work on MT5 but still no success.

 - first point I don't understand why inet_addr() func return me a different value when executed in MT4 vs MT5?

 - then looks like the struct2str is hitting out of range systematically? do you know what could be the cause ?

Thanks for your findings.

TCP socket
TCP socket
  • votes: 1
  • 2010.07.05
  • seth
  • www.mql5.com
placed utility functions from ryaz's server socket into socket.mqh, makes it really easy to use. comes with similar server example.
To add comments, please log in or register