[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question on UNIX sockets



On Mon, May 07, 2001 at 06:11:13AM +0000, nadeem_mistry@nucsoft.co.in wrote:
> Hi,
> 
> My question is :
> 
> Suppose a server is listening to 5 clients, and it has to send a
> message to all the clients, how does the server achieve this task?

A server typically consists of 2 programs: one that listens for
incoming connections, and one that services the connection (that
latter one can be a thread rather then full-weight process). In your
scenario there will be one "master" program and 5 "server"
programs/threads. So, the "master" program would send a 
signal/message/whatever to 5 "server" threads, and they would each 
forward the message to their clients.
This is one way of doing it.

Dima
-- 
E-mail dmaziuk at bmrb dot wisc dot edu (@work) or at crosswinds dot net (@home)
http://www.bmrb.wisc.edu/descript/gpgkey.dmaziuk.ascii -- GnuPG 1.0.4 public key
Well, lusers are technically human.                   -- Red Drag Diva in asr



Reply to: