pasky / pachi

A fairly strong Go/Baduk/Weiqi playing program
http://pachi.or.cz/
GNU General Public License v2.0
505 stars 117 forks source link

Read Pipe problem #123

Open FynjyAC opened 5 years ago

FynjyAC commented 5 years ago

Greetings. I have a problem with the "write pipe" function in UE4. I read the data from the "readPipe" without any problems. But when I try to send data "genmove b" through "writePipe", I get the same in the response in "readPipe".

  1. I create a process FProcHandle ProcessHandle = FPlatformProcess::CreateProc(tFilename, tArguments, false, false, false, NULL, 0, tWorkingDirectory, goWritePipe, goReadPipe);
  2. i wait 2 seconds
  3. Read from ReadPipe FString myOut = FPlatformProcess::ReadPipe(goReadPipe); I get all the initial information
  4. I wait 2 seconds
  5. I send a "genmove b" to the WritePipe if (FPlatformProcess::WritePipe(goWritePipe, "genmove b"))
  6. I wait 5 seconds and try ReadPipe. And I get "genmove b".
  7. But if I enter "genmove b" in the console of my process, I get all correct informations.

Could you give me any advice?

lemonsqueeze commented 5 years ago

Hi,

Could you give some context ? I have no idea what you're trying to do here. What is UE4 ?

FynjyAC commented 5 years ago

Hi. Thanks for participating
UE4 = Unreal Engine 4. Game Engine.
UE4 can use c++, but can't direct use windows library, windows.h. Instead, UE4 created its own library of functions with own realizations I'm trying to create a connection with pachi.exe through UE4 functions (in Windows used winApi pipe functions) https://docs.microsoft.com/en-us/windows/desktop/ipc/about-pipes

FynjyAC commented 5 years ago

The task is to transfer data between the Pachi and my c++ unreal engine project

lemonsqueeze commented 4 years ago

Try asking UE4 devs then, maybe they can help you with this ...

FynjyAC commented 4 years ago

Ok, I'll ask from the another side. How do you recommend to communicate with your program? Through pipe? Sockets? Or another ways? Can you recommend a program that already works with patch?

Pecka95 commented 1 year ago

Hey! Did you figure out wy its happens? I have the same problem and this thread the only one I found

Greetings. I have a problem with the "write pipe" function in UE4. I read the data from the "readPipe" without any problems. But when I try to send data "genmove b" through "writePipe", I get the same in the response in "readPipe".

jmoudrik commented 1 year ago

@Pecka95 - are you using UE as well? This feels like a problem in Your/FynjyAC's platform, commanding pachi by std pipe works fine.

Pecka95 commented 1 year ago

@Pecka95 - are you using UE as well? This feels like a problem in Your/FynjyAC's platform, commanding pachi by std pipe works fine.

Yeah, it's not about pachi, it's about Unreal Engine. Sorry for asking and botheting you here, but FynjyAC's problem it's the only one similar problem with mine which I could found and I don't know how to ask him directly

jmoudrik commented 1 year ago

Np, tho we cannot help with that here, I know nothing about UE.

My 2cent would be bad usage of the pipe setup function, i.e. you in fact read from the same buffer you write, or something like that. Also the concept of buffer flushing is also often source of confusion.

On Tue, Aug 23, 2022, 17:16 Pecka95 @.***> wrote:

@Pecka95 https://github.com/Pecka95 - are you using UE as well? This feels like a problem in Your/FynjyAC's platform, commanding pachi by std pipe works fine.

Yeah, it's not about pachi, it's about Unreal Engine. Sorry for asking and botheting you here, but FynjyAC's problem it's the only one similar problem with mine, which I could found and I don't know how to ask him directly

— Reply to this email directly, view it on GitHub https://github.com/pasky/pachi/issues/123#issuecomment-1224219920, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGV5PL76GD3VM65NBFVUODV2TTNLANCNFSM4H3FKGFQ . You are receiving this because you commented.Message ID: @.***>