Re: What is required to build a user server?

From: Andy Valencia <vandys_at_nospam.org>
Date: Mon Aug 23 1999 - 13:31:56 PDT

>In VSTa, a server is a process that creates one or more message ports
>and presumably receives on them every once in a while.
>...

Awesome stuff. I'm going to format this and put it in the docs section of
the WWW site.

>To be considered a server, a process creates a message port using the
>syscall msg_port(). There are basically two ways to call it:
>
> handle = msg_port(###, NULL);
>
> handle = msg_port(NULL, &portname);

I think the former argument is an integer, so "msg_port(0, &portname)" is
probably more correct. NULL happens to be 0 in current VSTa ports, but
consider that (void *)0 is also a valid value, and that would choke the
msg_port prototype, which expects an int (or rather, port_name, I think).

> M_ABORT : the client is no longer requesting the operation.
> Happens when the client is interrupted (by event,
> for example) while they're waiting for the server
> to respond. You'll likely only need to do any
> processing for this message if you poll for
> messages in between the msg_receive() and the
> msg_reply()/msg_err() of a client operation (i.e.,
> you're asynchronous).

What you write is quite correct, but I think I'll to mention that this is
very common in servers structured as event loops.

>Messages above M_RESVD are user messages. The most common ones are the
>filesystem messages:

I think I'll mention the explicit header files (sys/msg.h, sys/fs.h).

Andy
Received on Mon Aug 23 12:24:26 1999

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2005 - 15:12:56 PDT