I hope someone with interest/skills in Windows will respond at some point, but in the meantime, maybe you could try setting up your socket server process as a stand-alone app, and run two instances of it like this:
my $sspid1 = open( $sockserver1, "sock_server.pl -params |" ) or warn "can't start sock_server.pl: $!";
and likewise for the second process (and maybe you even want the file handles and pids to be in arrays).

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.