Nine Posted October 28, 2018 Posted October 28, 2018 Hi there, Made 2 very simple processes (Parent / Child). It is working fine except that once every while, the child doesn't receive the parent message. Yes it is intended that the child finishes after the reception of the message. Here's the parent : ;******** ConsoleWrite ********** #include <constants.au3> HotKeySet("{END}", "Terminate") HotKeySet("{F1}", "SendIt") Global $pid = run ("ConsoleRead.exe", "", "", $STDOUT_CHILD + $STDIN_CHILD) Global $count = 0 While True Sleep (50) Wend Func Terminate () exit EndFunc Func SendIt () $count += 1 StdinWrite ($pid, $count) $pid = run ("ConsoleRead.exe", "", "", $STDOUT_CHILD + $STDIN_CHILD) EndFunc Here's the child : ;******** ConsoleRead ********** #NoTrayIcon Global $text While True Sleep (50) $text = ConsoleRead () if @error then ExitLoop if $text = "" then ContinueLoop FileWriteLine ("Test.log", $text) Beep (500,25) ExitLoop Wend Any help would be greatly appreciated. Thanks for reading. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Nine Posted October 28, 2018 Author Posted October 28, 2018 26 views and no reply. Can this be a bug ? Please your idea will be truly rewarding... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
caramen Posted October 29, 2018 Posted October 29, 2018 (edited) Hi, Seem like this line make you wait sometime. if $text = "" then ContinueLoop You should control the return value anyway before playing with it. Because what is happenning if $text = what ever any different string than "" ? Oh btw the number of views does not determine how someone wil be able to help you :/. Edited October 29, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
Nine Posted October 29, 2018 Author Posted October 29, 2018 Hi Caramen, whenever there is nothing to ConsoleRead, it will return a "". ConsoleRead doesn't wait for something to be sent by the parent. So it must be tested at first to see if some characters has arrived. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
caramen Posted October 29, 2018 Posted October 29, 2018 Yeah this is what i was mentionning. But by the oposite way/ whenever there is NOT nothing to ConsoleRead, it will NOT return a "". So it will NOT continu loop. My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
Nine Posted October 29, 2018 Author Posted October 29, 2018 Exactly this is the intention. In order words, whenever child receive a char, it must be exited. I know it sounds weird but it is just a test. The problem is not there. The problem is that sometimes consoleread says it has nothing to read but the fact is that parent has sent something. Happens every 50-60 writes... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
caramen Posted October 29, 2018 Posted October 29, 2018 (edited) 35 minutes ago, Nine said: The problem is that sometimes consoleread says it has nothing to read but the fact is that parent has sent something. Ok, then do you see the message in the second scite console output ? I dont want to be unpleasant. But this should be in your first post so we dont have to try to figure out what is going on before trying to help. This is maybe the main reason why no one unswer. When i read you ... i understand there is no problem and this is a normal script reaction... You got a script that will stop looping when you got a message and you asking help on why your script isn't working when you got a message, each 50 60 run. Or i miss somthing ? Edited October 29, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
Nine Posted October 29, 2018 Author Posted October 29, 2018 Sorry if I am not clear, English is not my first language. Let me try to clarify. If you run parent "ControlWrite" and you press F1 50-60 times quite rapidly, you will see that child "ConsoleRead" will not capture ONE of the message sent by parent. It will skip one message. It is clear in the log file that one message has not been captured but all the other messages has been well received. Since all the messages are incremental numbers, it is very easy to notice one message has not been read. Hope it is more clear now. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Danp2 Posted October 29, 2018 Posted October 29, 2018 It's possible that you've made a bad assumption that the issue is with the ConsoleRead command. Maybe the problem is with FileWriteLine instead. Latest Webdriver UDF Release Webdriver Wiki FAQs
Nine Posted October 29, 2018 Author Posted October 29, 2018 No, Danp2 because I also don't hear the beep and a second child process exists when I go take a look in Window Task Manager. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Nine Posted October 29, 2018 Author Posted October 29, 2018 (edited) Ok found something, it is not ConsoleRead the problem, it is stdinwrite. For some reason, stdinwrite will write 0 char to the channel from time to time. It is not giving an @error but the return value of stdinwrite equals 0. A small loop that execute stdinwrite repeatedly until the returned value > 0 solve the problem. But I still don't understand WHY stdinwrite would send a 0 byte message. I do believe tho it is a bug. Edited October 29, 2018 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now