You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Market Simulation: (Part 11): Sockets (V).
Now recall that the mini-chat server uses port 27015, and the echo server — which will run via Excel — also uses the same port. Therefore, theoretically, we have a conflict of interest here. One might assume the operating system would not allow a server to interfere or attempt to listen on the same port using the same protocol. In this case, we are using the TCP protocol. However, we could use TCP on one server and UDP on the other. In that scenario, there would be no issue using the same port.
But when we use the same port, the same protocol, and the same host, things get a bit more complicated.
I want to emphasize this point so that those aiming to become advanced users of sockets understand that working with them requires certain precautions. I want you — before you see how the communication between Excel and MetaTrader 5 is actually implemented — to understand what happens when two different servers use the same resources. In this case: the same protocol, the same port, and the same host. To grasp this, first open the mini-chat server and let it wait for a connection.
Now open the echo server in Excel and leave it waiting for a connection as well. That is, we’ll have something resembling this:
Author: Daniel Jose