Discussion of article "Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs" - page 6

 
Igor Semyonov:

I have a question like this:

The article states:

Connect to the server by double checking: to the remote computer named 'RemoteServerName' or to the local computer. On the local one everything works and there are no questions.

But if you run PipeServer.exe on a remote VPS, and then throw the client script to the chart on another PC, having changed RemoteServerName to the name belonging to the VPS, then the server and the client do not see each other, i.e. the channel does not work, there is no connection.

What is the problem here, is it that the name of a particular VPS should be initially written in PipeServer.exe or what?

it would be interesting to hear the solution,

if the developers have specified the possibility to use it for a remote computer, it should probably work.

I hope the developers here can help with an example of how to realise this on a remote computer.

 

Is any body using this client-sever? For what and how?

I read at the beginning:

"A script from the terminal will connect to this server and will exchange data with it."

May I ask how can I connect two clients running on two different terminals via this server? As far as I understand the server and the tests only one client connects to the server and what can this server do with the messages it has received?

Wouldn't it be necessary to have

1) an independent server waiting for multiple clients,

2) each client to start the connection by sending a unique ID of itself,

3) a server sending to every connected client any message that the server has received - may be except to the client it has got the message from,

4) a server sending each message beginning with the unique ID of the client which has sent the message?

- This way the client can detect its own messages and delete them - if they were send back by the server, by what ever reason.

- This way the client can detect the client(s) it should listen too - must be part of the mq4-code of the client.

 
Apologies - googled the translation.
I don't understand the point at all! What does the server do with the data as I get from there in another client?
Here I projected a rational solution: Link to English discussion. Presumably someone can write an English answer?
Many thanks, Calli
 

Solution presented here does not work with Async Named Pipes. Please see https://www.mql5.com/en/forum/94343

 Newgel 

MQL5 Asynchronous named pipes?
MQL5 Asynchronous named pipes?
  • www.mql5.com
I´m trying to integrate MT5 with an external Named Pipe Server application written in C# through named pipes...
 

Good afternoon MetaQuotes.

Can you tell me if there are plans to add a function analogue of WaitNamedPipe() from WinAPI to MQL4/5?

Such a function would remove the need for MQL clients to query the channel via FileOpen() in an infinite loop, while waiting for the server to open an instance of the channel. This is especially useful when the wait is long.

 
codesurfer:

Good afternoon MetaQuotes.

Can you tell me if there are plans to add a function analogue of WaitNamedPipe() from WinAPI to MQL4/5?

Such a function would remove the need for MQL clients to query the channel via FileOpen() in an infinite loop, while waiting for the server to open an instance of the channel. This is especially useful when the wait is long.



Such questions are best asked in Service Desk through your profile.
 

Hello.

I start PipeServer.exe, run the pipeclient.mq5 script in debug mode. The script is looping here:

//--- wait for pipe server
   while(!IsStopped())
     {
      if(ExtPipe.Open("\\\\REN\\pipe\\MQL5.Pipe.Server",FILE_READ|FILE_WRITE|FILE_BIN)!=INVALID_HANDLE) break;
      if(ExtPipe.Open("\\\\.\\pipe\\MQL5.Pipe.Server",FILE_READ|FILE_WRITE|FILE_BIN)!=INVALID_HANDLE) break;
      Sleep(250);
     }

What am I doing wrong?

System: Windows 7 Ultimate (x64 based PC), IE 11.00, RDP, UAC, AMD FX-8300 Eight-Core Processor , RAM: 5601 / 8190 Mb, HDD: 14763 / 114370 Mb, GMT+02:00
Terminal: MetaTrader 5 x64 build 1643 started (MetaQuotes Software Corp.).

P.S. I run PipeServer as Administrator.

 

Who can help to launch the MQL5+python test binder? I am ready to compensate labour costs.

I need a working example of implementing function calls from a Python script.

I am trying to make a function in MQL5 interacting with a Python script, but not through a file. I need a quick exchange of arguments.

I would be grateful for any example, for example, to pass some numbers from MT, and the Python script would return for example the sum of numbers back to MT.


 
mavar:

Who can help to launch the MQL5+python test binder? Ready to compensate labour costs.

I need a working example of implementing function calls from a Python script.

I am trying to make a function in MQL5 interacting with a Python script, but not through a file. I need a quick exchange of arguments.

I would be grateful for any example, for example, to pass some numbers from MT, and the Python script would return for example the sum of numbers back to MT.


Implemented the server in C#, I think everything is ok. On Python I think it is not more difficult.

 

Are there plans to add a function to the library that checks if the connection to the server is open? As I understand it, there is no such function now.

Handle retains non-zero value even if connection to the server is lost.