Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!masscomp!yoyodyne!black From: black@yoyodyne..westford.ccur.com (Sam Black) Newsgroups: comp.windows.x Subject: Re: clint server com Keywords: communication Message-ID: <61450@masscomp.ccur.com> Date: 21 Nov 90 14:46:11 GMT References: <1011@babcock.cerc.wvu.wvnet.edu> Sender: news@masscomp.ccur.com Reply-To: black@westford.ccur.com (Sam Black) Organization: Concurrent Computer Corp. Westford MA. Lines: 23 > > I know that server program is listening on port 6000 for display 0. Can > sombody explain to me how two clients communicate with one server on the same > display? Thanks. > When a client opens the listener socket (port 6000+display), the server makes an "accept" system call, which switches the server's end of the socket to another port. Thus, if the listener is file descriptor 0, and this is the first client, the "accept" call will open file descriptor 1 as a new socket to the client. The client does not have to do anything special; its end of the socket remains as is. - sam ------------------------------------------------------------------------------- Once you remove the absurdity from human existence, there isn't much left. __________ / _______/__ ...!{decvax,uunet}!masscomp!black /__/______/ / black@westford.ccur.com Concurrent /_________/ Computer Corporation -------------------------------------------------------------------------------