home | list info | list archive | date index | thread index

[OCLUG-Tech] Sockets - need concept only.

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