Return to BSD News archive
Xref: sserve comp.client-server:435 comp.unix.wizards:29017 comp.unix.questions:32623 comp.unix.bsd:11730 Newsgroups: comp.client-server,comp.unix.wizards,fr.network.divers,comp.unix.questions,comp.unix.bsd Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!usc!enterpoop.mit.edu!thunder.mcrcim.mcgill.edu!mouse From: mouse@thunder.mcrcim.mcgill.edu (der Mouse) Subject: Re: Point-to-Point Sockets communication Message-ID: <1993Mar30.073753.3679@thunder.mcrcim.mcgill.edu> Followup-To: comp.client-server,fr.network.divers,comp.unix.questions,comp.unix.bsd Organization: McGill Research Centre for Intelligent Machines References: <1993Mar26.193559.13662@jussieu.fr> Date: Tue, 30 Mar 93 07:37:53 GMT Lines: 29 > Newsgroups: comp.client-server,comp.unix.wizards,fr.network.divers,comp.unix.questions,comp.unix.bsd Crossposting to comp.unix.wizards and comp.unix.questions is just about never appropriate. I'm removing comp.unix.wizards from followups. In article <1993Mar26.193559.13662@jussieu.fr>, truongta@amertume.ufr-info-p7.ibp.fr (Vincent) writes: > My problem is that i'm trying to connect 2 processes without obliging > one of them to be server or client. Once the connection is established, the distinction between server and client is purely convention. Just pick one of the processes to do the bind/listen/accept and the other to do the connect; once you have the connection, close the socket that did the accept and you have a bidirectional stream, with neither direction distinguished. > But, to me, sockets are only good for c/s connection. You should work on shaking that mindset. This is how they are usually used, but there's nothing in the socket paradigm that requires it. Your example code leads me to think that the processes share a cooperative ancestor. In this case, you may want to look at socketpair(). der Mouse mouse@mcrcim.mcgill.edu