[openbeosnetteam] socket lib...

  • From: "David Reid" <dreid@xxxxxxxxxxxx>
  • To: "OpenBeOS Network Team" <openbeosnetteam@xxxxxxxxxxxxx>
  • Date: Wed, 20 Feb 2002 14:17:56 -0000

Now, this may sound crazy, but what the heck... Maybe it'll help others?

Basically the socket lib should be implemented such that we have a
libsocket.so that user apps can link against. In fact apps such as arp, ping
and friends will link against it as well. It implements such things as
- socket() to create a socket
- send()/recv() to write/read data from a socket (so named to avoid
namespace collision)
- ioctl()/getsockopt()/setsockopt() to control how our socket behaves
- select() on a socket (might actually want to add poll :))
- closesocket() to close a socket we've created

I'm sure there's more that I haven't listed, but that's the basic. What I
can't figure out (and again I've been up all night so this may be obvious)
is how we do this. I mean we have a server running as a process and the
stack lives within that process. So, we need to somehow call into the stack
to pass in/out data, but that's the bit I don't get. I could see the
/dev/socket idea whereby we'd just have a really nice simple wrapper around
it and the functions would be controlled via the stack, or thinking about it
could I?  Sorry for being dense here, but maybe Axel can jump in and explain
it? BTW, in case you haven't guessd it'll need to be a very simple
explanation!

david



Other related posts: