Sockets are a nice abstraction of interprocess communications which hides from the programmer all issues related to networking. It won't matter if the two processes are running on the same machine or on different continents, the socket abstraction hides all of that. It hides a bunch of other things too: error checking and correction; ensuring that data is received in order and so on. All the other mechanisms you listed either won't work across a network or don't have the degree of abstraction that sockets do. Michael On August 9, 2005 12:54 pm, William Case wrote: > Hi; > > I am 2/3 the way through Richard Stevens "UNIX Network Programming" > and I seemed to have missed something about sockets. A really quick > short explanation would be helpful. The question I have is: > > "Why do I need a socket in the first place?" > > A socket is used for interprocess communications, is it not? If I were > to sit down to write a communications program, why would I say to myself > "OK, one of the first things I need is to create a socket"? Why not > shared memory, a buffer, an open user space file to write to and read > from? > > Really, most of what I have read in Steven's text, in the man pages or > google I can follow, but nothing I've read answers what to me is the > first question "Why would I do it?" The literature I have read tells me > how to create and use a socket, but nothing states bluntly why. > > I'm guessing, but are sockets the only way to communicate between > modules in the kernel and stuff in user space (processes, data, > programs)? And if so, is that accomplished with the system calls? > > Regards Bill > > > > > > _______________________________________________ > Linux mailing list > Linux [ at ] lists [ dot ] oclug [ dot ] on [ dot ] ca > http://www.oclug.on.ca/mailman/listinfo/linux