and likewise for the second process (and maybe you even want the file handles and pids to be in arrays).my $sspid1 = open( $sockserver1, "sock_server.pl -params |" ) or warn "can't start sock_server.pl: $!";
This assumes that your sock_server.pl is designed so that: it gets all the info it needs for start-up (port number, etc) from command-line params; it uses its own internal file handles for reading/writing on the socket; and it writes whatever reports you want to its own STDOUT.
As indicated in the other reply, you'll need to set up the appropriate mechanism in Tk for reading from these processes while the GUI is handling input events from the user; I think Tk::FileEvent might do for that.
As for controlling the processes themselves (starting and stopping), maybe there's a way on Windows to send "suspend" and "resume" signals, or if it's not a big deal, just close those file handles (killing the processes) and reopen (restart) them as needed.
In reply to Re: How to run multiple server processes under Tk?
by graff
in thread How to run multiple server processes under Tk?
by noslenj123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |