Turner wrote:
> Hello Perl gurus,
>
> I'm currently in the process of writing a chat server in Perl.
> Everything is all hunky-dory--it parses commands as it should, and is,
> of course, quite satisfying. Except for one thing, and that is that it
> cannot handle multiple clients at once, which, needless to say, is
> kind of useful for a chat program, isn't it? So I've been following
> the discussion online of Threads vs. forking vs. non-blocking IO, and
> I've decided to try threads, which is neat because this is the first
> thing I've ever done with threading. However, my excitement has been
> somewhat dampened by the fact that it does not work. It can still
> happily handle a single client--no complaints there. However, it can
> still ONLY handle a single client. There's probably a hole in my
> understanding of threads (e.g., I don't entirely understand what
> join() and detach() DO...). Below is the relevant server code, and I
> was hoping some kind soul could look at it, suppress his laughter at
> my naive code and point me in the right direction.
>   
[...]

If you just want to handle multiple clients, you may want to look at the
select() function.
(See the bottom part in the perldoc-umentation. The one with RBITS,
WBITS, ... or here
http://www.perlfect.com/articles/select.shtml)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to