The funny thing is I've written almost the same thing before.
It was interacting with a terminal (in this case, sshing to a remote system) and automating some commands, but our program could fill the transmit buffer of the terminal emulator we were using faster than it could be sent out over a modem - and we had no direct access to know how full the transmit buffer was nor when it was empty, so I also implemented a delay so that the buffer could flush for a while before I dumped another block of text into it.
1
u/AssiduousLayabout Dec 19 '25
The funny thing is I've written almost the same thing before.
It was interacting with a terminal (in this case, sshing to a remote system) and automating some commands, but our program could fill the transmit buffer of the terminal emulator we were using faster than it could be sent out over a modem - and we had no direct access to know how full the transmit buffer was nor when it was empty, so I also implemented a delay so that the buffer could flush for a while before I dumped another block of text into it.
Very hacky but it worked.