The performance of fork is system-dependent. Linux provides a very inexpensive fork, the task generation and switch being faster than threads due to Copy On Write for the environment and other optimizations. Windows perl emulates fork with win32 native threads which I believe to be rather expensive.

IO::Select is a wrapper for perl's 4-arg select. It is, in effect, a sleep-until-I/O-ready operation.

You don't say what examples you have tried, but "They don't print any of the data that I send to them" sounds like you have problems with either buffering or making the connection from a client. Or maybe just the printing. You need to show code to get a diagnosis from us.

It's de rigeur to recommend POE at this point, but I'm not going to do that yet. It's worthwhile to learn to use bare metal sockets and fork.

After Compline,
Zaxo


In reply to Re: request, IO::Socket Select() & Fork() example by Zaxo
in thread request, IO::Socket Select() & Fork() example by Treehunter

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.