How about creating something practical using sockets? In today's article, we'll start creating a mini-chat. Let's look together at how this is done - it will be very interesting. Please note that the code provided here is for educational purposes only. It should not be used for commercial purposes or in ready-made applications, as it does not provide data transfer security and the content transmitted over the socket can be accessed.
In the previous article, Market Simulation (Part 07): Sockets (I), I demonstrated the first steps to get you started with studying sockets. However, the application shown there might not have been particularly exciting. To be honest, it was more like a "HELLO WORLD" program - the first program we usually try when learning something new in programming. It was a first step on a long journey.
So, in this article, I will show you how to create something a bit more interesting. To be clear, it won't be particularly useful, but it will allow you to experiment and have some fun while studying the concepts involved. Just like in the previous article, we will need to rely on external code. Again, the reason for using external code is that I don't want to add DLLs to MetaTrader 5, at least not yet.
Regarding the external code, I won't go into too much detail about how it works. You can find various codes that perform the same type of task or create your own by studying the references I mentioned in the previous article. So, what are we going to do in this article? Essentially, I want to demonstrate how sockets can be interesting. I also intend to make some use of them in the replay/simulator system. We will approach this in the simplest way possible: by creating a Mini Chat. That's right - I will show you how to create a Mini Chat in MetaTrader 5.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Check out the new article: Market Simulation (Part 08): Sockets (II).
In the previous article, Market Simulation (Part 07): Sockets (I), I demonstrated the first steps to get you started with studying sockets. However, the application shown there might not have been particularly exciting. To be honest, it was more like a "HELLO WORLD" program - the first program we usually try when learning something new in programming. It was a first step on a long journey.
So, in this article, I will show you how to create something a bit more interesting. To be clear, it won't be particularly useful, but it will allow you to experiment and have some fun while studying the concepts involved. Just like in the previous article, we will need to rely on external code. Again, the reason for using external code is that I don't want to add DLLs to MetaTrader 5, at least not yet.
Regarding the external code, I won't go into too much detail about how it works. You can find various codes that perform the same type of task or create your own by studying the references I mentioned in the previous article. So, what are we going to do in this article? Essentially, I want to demonstrate how sockets can be interesting. I also intend to make some use of them in the replay/simulator system. We will approach this in the simplest way possible: by creating a Mini Chat. That's right - I will show you how to create a Mini Chat in MetaTrader 5.
Author: Daniel Jose