in reply to endless loops for server and tk
Tcl/Tk has fileevent which resolves the problem.
I have written bluetooth COM-keyboard driver this way, which works both for linux and windows. The essential part is
This is what you asked - file operations awake callbacks when in GUI MainLoop.use Tcl::Tk; my $int = new Tcl::Tk; # ..... $int->fileevent($fhbt, readable => \&process_keyboard); # .... $int->MainLoop;
|
|---|