I’ve got a basic behavior I’d like to implement in a console app:
to quit if no input is received within a given amount of time.
Is this even possible? I had this in the main run event, and have tried moving it out to a it’s own thread:
Dim sLine As String = Stdin.ReadLine
But I can’t release the process. Once input is asked for, is there any way to just quit? Quit in the main thread won’t quit. Thread.Kill followed by quit won’t quit. Changing the Stdin to read characters won’t allow the process to quit until the requested number of chars are received. It simply doesn’t appear to be possible, yet the behavior is trivial: no key press after awhile, just quit.
Alternatively, I’ve thought about suicide; But is there any cross platform way I can find the process id of myself (the running console app) to shell a kill command?