My implementation mainly involves not destroying the telnet server on remote keyboard destroy, and a couple changes that necessarily follow from this.
An alternative approach might be to return from server input loop, but maintain socket connection in connection accept loop, blocking there on a semaphore signaled when ime is returned to remote keyboard, and then restarting the input loop. This however might make for an unnecessarily busier input loop (input loop polling for whether it should exit), as the present implementation already has the input loop blocking on io read.
My implementation mainly involves not destroying the telnet server on remote keyboard destroy, and a couple changes that necessarily follow from this.
An alternative approach might be to return from server input loop, but maintain socket connection in connection accept loop, blocking there on a semaphore signaled when ime is returned to remote keyboard, and then restarting the input loop. This however might make for an unnecessarily busier input loop (input loop polling for whether it should exit), as the present implementation already has the input loop blocking on io read.
Comments, observations, suggestions, advice appreciated.