I am beginning to see some... unanticipated behaviour from this. With the way your loop is set up, the forked server will not notice the pipe is broken until the file has changed.

For example,

server.pl 59683: server started on port 8870 at Wed Apr 5 16:28:55 20 +00 server.pl 59683: connection from localhost [ 127.0.0.1 ] at port 2110 +at Wed Apr 5 16:29:16 2000 server.pl 59683: begat 59693 at Wed Apr 5 16:29:16 2000
I broke that connection at 16:29:25. It is now 16:32:08 and I have not seeen the reap message. If cause the file I am monitoring to be updated ( approx 16:33:09 ), the reaping code is fired and I see:
broken pipe at server.pl line 50 main::SELFREAP('PIPE') called at server.pl line 82 main::__ANON__() called at server.pl line 113 main::spawn('CODE(0x804e054)') called at server.pl line 89 server.pl 59683: reaped 59693 with exit 65280 at Wed Apr 5 16:34:02 +2000
If I add this:
if ( eof(<STDIN> ) { confess "No more socket?"; $nodie = 0; last; }
after your call to seek, the spawned server dies when I would expect.

If I am still smoking crack, I will give up on this problem a apologize again for wasting everybody's time.

Mik
Mik Firestone ( perlus bigotus maximus )


In reply to Re: TCP/IP by mikfire
in thread TCP/IP by Jason0x21

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.