Hello fellow monks, I have been experimenting with and working around transfering a set of clients connected to a multiplexing server using IO:Select to the same script, but after it has been restarted. I had the problem initially of it not being able to reopen the port... fixed that by having a second script do the actual restarting of the script...
So, what i have now is a system call from script 1 to script 2, which then calls script 1 again. it seems way out of the way from what i think perl is capable of. that solved one problem none the less, the second problem is actually transfering the clients which are held in a hash, i initially thought that just setting the hash in the new script as the old hash may work... didnt. but i cant figure out how to resocket-ify the clients to the new script. Thats where im lost, i just need to know what would be used to resocket them. here is some of the code to show the contents of the clients hash of hashes and how it was created, hopefully enough to help.
my $ready = (IO::Select->select($select,undef,undef,undef))[0]; foreach my $s (@$ready) { if ($s == $listener) { my $new_sock = $listener->accept; $clients{$new_sock} = { socket => $new_sock, input => '', ip => $new_sock->peerhost }; } }
My ultimate goal is to be able to restart the script with any changes that have been made and keep all the clients from having to log back in.


I love the smell of pastures in the morning... /tell ahbeyra moo

In reply to Restarting a script without dropping clients by Ahbeyra

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.