Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.unix-wizards Subject: Re: AF_UNIX domain socket question. Message-ID: <6144@umcp-cs.UUCP> Date: Wed, 29-May-85 05:31:34 EDT Article-I.D.: umcp-cs.6144 Posted: Wed May 29 05:31:34 1985 Date-Received: Fri, 31-May-85 02:26:06 EDT References: <213@greipa.UUCP> Organization: U of Maryland, Computer Science Dept., College Park, MD Lines: 27 > Can several processes write to a unix-domain stream socket at the > same time and preserve the 'atomic' nature of each call? Yes, if you're lucky. > Should I be using datagram sockets? Probably. > Even more important to this discussion, can several processes write > to a socket without 'connecting' to it? I.E. calling socket and > binding the descriptor to an existing socket (unix file) then reading/ > writing directly to the socket without calling connect. The reason > being that I need to server to go into a read wait on a socket > for data that could come from several processes at different times. > I'd like to give each process its own socket in the usual way, but > that means I'd have to go into an accept wait... (Ignoring the fact that that AF_UNIX SOCK_DGRAMs are connectionless...) Not true; you can use select to tell you which of the r/w sockets and/or the original bound socket are ``readable''. Select for reading succeeds when the accept() system call will not block. This is well-known in a couple of servers and isn't likely to change.... -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland