Inter-process communication problem
-
Hello everybody! I have two process (father and child) and my implementation was all based in the article How to spawn console processes with redirected standard handles. Everything works fine, send command and receive answers from the child process (command line)... but, it works just a few times (two to be more exactly). In the third command that I send, there is no answer. The WriteFile function does not give any error, and the ReadFile ('Threaded') function don't receive any bytes and don't accuse any errors to. In this case, I'm even using the PeekNamedPipe function to know how much bytes (if it's there) I have to read. It's strange to me... everything is working fine, but suddenly stops working. :sigh: Does anybody here already have this problem or knows what I'm doing wrong? Thanks in advance! cheers!
-
Hello everybody! I have two process (father and child) and my implementation was all based in the article How to spawn console processes with redirected standard handles. Everything works fine, send command and receive answers from the child process (command line)... but, it works just a few times (two to be more exactly). In the third command that I send, there is no answer. The WriteFile function does not give any error, and the ReadFile ('Threaded') function don't receive any bytes and don't accuse any errors to. In this case, I'm even using the PeekNamedPipe function to know how much bytes (if it's there) I have to read. It's strange to me... everything is working fine, but suddenly stops working. :sigh: Does anybody here already have this problem or knows what I'm doing wrong? Thanks in advance! cheers!
This is just a guess since no one else replied. Most of my IPC experience is socket based. If you don't solve this you might try that approach. Anyway the IO streams might have ( based on a vague memory ) error states that you need to reset (clear) before each read and/or write operation. Hope that helps.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum led mike
-
This is just a guess since no one else replied. Most of my IPC experience is socket based. If you don't solve this you might try that approach. Anyway the IO streams might have ( based on a vague memory ) error states that you need to reset (clear) before each read and/or write operation. Hope that helps.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum led mike
Hi led mike! Thanks for your answer. I've been searching for those error states that need to reset, but I don't found them in MSDN and nowhere. I've been thinking about use named pipes (I'm using anonymous), but this really scares me... my project is already late, and the use of named pipes will demand a whole new approach. Thanks for your help led mike, best regards
-
Hi led mike! Thanks for your answer. I've been searching for those error states that need to reset, but I don't found them in MSDN and nowhere. I've been thinking about use named pipes (I'm using anonymous), but this really scares me... my project is already late, and the use of named pipes will demand a whole new approach. Thanks for your help led mike, best regards
Rember this is just wild guessing http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_clearerr.asp[^]
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum led mike