AF_UNIX domain socket question.

Jordan K. Hubbard jordan at greipa.UUCP
Tue May 28 18:00:00 AEST 1985


[ Also posted to su.unix.wizards ]

Hi.

Can several processes write to a unix-domain stream socket at the
same time and preserve the 'atomic' nature of each call? (say two
processes wrote out a 7 byte structure to the same socket, could
this become garbaged?) Should I be using datagram sockets?

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, and I want to be
able to respond to data sent by earlier processes more or less immediately.
(The number of processes communicating with the same server is arbitrary,
but they're all related and need to access one set of data known to
the server)


If there's a decent way of doing this and I'm too thick/ignorant
to realize it, I'd welcome any suggestions..

					Thanks.
-- 
			Jordan K. Hubbard
			@ Genstar Rental Electronics.
			Palo Alto, CA.
			{pesnta, decwrl, dual, pyramid}!greipa!jordan

			"Ack ack!".

				- William the feline



More information about the Comp.unix.wizards mailing list