pachi icon indicating copy to clipboard operation
pachi copied to clipboard

Read Pipe problem

Open FynjyAC opened this issue 5 years ago • 9 comments

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?

FynjyAC avatar Jun 25 '19 07:06 FynjyAC

Hi,

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

lemonsqueeze avatar Jun 28 '19 16:06 lemonsqueeze

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 avatar Jun 28 '19 16:06 FynjyAC

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

FynjyAC avatar Jun 28 '19 17:06 FynjyAC

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

lemonsqueeze avatar Jul 03 '19 10:07 lemonsqueeze

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?

FynjyAC avatar Jul 03 '19 11:07 FynjyAC

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".

Pecka95 avatar Aug 23 '22 09:08 Pecka95

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

jmoudrik avatar Aug 23 '22 14:08 jmoudrik

@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

Pecka95 avatar Aug 23 '22 15:08 Pecka95

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: @.***>

jmoudrik avatar Aug 25 '22 19:08 jmoudrik