RPCs as message passing system

RPCs as message passing system

Post by Enrico Silter » Thu, 06 Aug 1992 02:59:13

I am trying to use RPCs as an asynchronous message passing system.
To do this, I am using the code in SUN's Network Programming Manual,
Chapter 4.  I do not see a clear statement of how a message can
be sent, with no reply, or acknowledgement expected.  I have tried using
the code in the CallBack section, but this seems to wait for a response
to the callrpc().
Any hints on how this can be done would be greatly appreciated.

Mail: Rick Silterra                   <<Being a BALD HERO is almost as FESTIVE as a TATTOED KNOCKWURST.>>
      Northern Telecom           << ESC-52 M-X yow >>
      Network Applications
      Systems Group
      97 Humboldt St.                 Any opinions expressed above are my own,
      Rochester NY 14609-7493         and not those of any group with which I am

1. System V.2 IPC (msgop - message passing) ?

Question about System V message passing (IPC):

In the man pages for msgop(2), it shows the message to be passed
as type *msgbuf.  The man pages say the struct is:

struct msgbuf{
        int     mtype;  /* type of message (arbitrary) */
        char    mtext[];        /* body of message */

Now this implies that the pointer mtext can be assigned to an
array or can be malloc'd to. (which makes sense)

However, looking at the include file when this is defined <sys/msg.h>,
it defines the structure like this:

struct msgbuf {
        int     mtype;
        char    mtext[1];       /* note the '1' */

What is going on here, I can't redefine this pointer, and I certainly
can't pass descent messages in *1* byte.

Of course the work around is obvious, define the structure myself as:

struct whatever {
        int     mtype;
        char    mtext[100];     /* or  char *mtype  */

This works just fine, however, it is no longer portible code.
What if some versions of sys V (maybe some in the future) throw
in another flag.  Then my code is F*CKED.

So, anyone know the story??  This is not an isolated case, as both
HP-UX (based on sys V) and even Sun's System V compatibility mode
use this same definition (char mtext[1]).

Thanx in advance (as usual),

**************** Insert 'Standard' Disclaimer here:  OOP ACK! *****************
*  Tony Parkhurst -- {hplabs|sdcsvax|ncr-sd|hpfcla|ihnp4}!hp-sdd!artecon!adp  *


2. Dip-problems

3. Need help with rpc.statd and rpc.lockd messages (AIX 3.2)

4. eth interface hardware-problem?

5. RPC - system call to support RPC API

6. Comparing strings

7. How to change default icons in GNOME (MC)?

8. How to use rpc.portmap, rpc.mountd, rpc.nfsd?

9. Where are rpc.portmap, rpc.mountd, rpc.nfsd?

10. Dangers of rpc.portmap, rpc.mountd, rpc.nfsd

11. RPC 4.0 vs RPC 4.1 vs TI RPC