[Info-vax] Network mailbox

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Fri Oct 28 11:21:03 EDT 2011


In article <j8dgi6$pph$1 at speranza.aioe.org>, Snowshoe <no at spam.please> writes:
>I have my network mailbox silliness working -- sort of. The problem I 
>have is that RMS doesn't deliver the messages one at a time, it sort of 
>saves them up and then unleashes them all at once. I implemented this as 
>a process that reads a (local) mailbox and writes what's there to a 
>remote mailbox over a DECnet link.  I also do the reverse (different 
>mailbox pair) and have the same problem - a $GET doesn't do anything 
>until there are a bunch of messages.  This happens even though the 
>remote FAL process reads the messages one at a time, immediately.  It is 
>the local RMS or DECnet at fault.
>
>How to tell RMS to give me the messages one at a time?  RAB$M_TMO seems 
>to be ignored.
>
>   mbx2_fab = cc$rms_fab;
>   mbx2_fab.fab$l_fop = FAB$M_SQO;
>   mbx2_fab.fab$b_fac = FAB$M_PUT;
>   mbx2_fab.fab$b_org = FAB$C_SEQ;
>   mbx2_fab.fab$b_rat = FAB$M_CR;
>   mbx2_fab.fab$b_rfm = FAB$C_RFM_DFLT;
>   mbx2_fab.fab$l_fna = "REMOTE::MBA1234:";
>   mbx2_fab.fab$b_fns = 16;
>   mbx2_fab.fab$w_mrs = 5000;
>
>   status = SYS$OPEN(&mbx2_fab);
>   if (!(status & 1)) lib$signal(status);
>
>   mbx2_rab = cc$rms_rab;
>   mbx2_rab.rab$l_rop = RAB$M_TMO;
>   mbx2_rab.rab$b_tmo = 0;
>   mbx2_rab.rab$l_rbf = rec_buffer2;
>   mbx2_rab.rab$l_fab = &mbx2_fab;
>
>   status = SYS$CONNECT (&mbx2_rab);
>   if (!(status & 1)) lib$signal(status);
>
>....
>
>void mbx2_ast(void) {
>   int status;
>   int len;
>   char zzz[5000];  //debug
>
>// status from last mbx read
>
>   status = mbx2_iosb.status;
>   if (!(status & 1)) lib$signal(status);
>
>// debug
>
>   len = mbx2_iosb.byte_cnt;
>   memcpy(zzz,rec_buffer2,len);
>   zzz[len] = '\0';
>   printf (">>> size = %d |%s|\n",len,zzz);
>
>// end debug
>
>   mbx2_rab.rab$w_rsz = mbx2_iosb.byte_cnt;
>   status = SYS$PUT(&mbx2_rab);		// write to remote mailbox
>   if (!(status & 1)) lib$signal(status);
>
>// queue next read
>
>   status = sys$qio (1, mbx_chan2, IO$_READVBLK, &mbx2_iosb, mbx2_ast, 0,
>                     rec_buffer2, sizeof(rec_buffer2), 0, 0, 0, 0 );
>   if (!(status & 1)) lib$signal(status);
>}
>

Why are you using RMS to read and write the mailbox?  The mailbox driver
has special function modifiers (ie. IO$M_NOW) that can be used with $QIO
IO$_READVBLK and IO$_WRITEVBLK when the target device is a mailbox.  The
$QIO IO$_READVBLK would normally wait and only complete when there's been
a message deposited into the mailbox.  This you apparently have correct.

I'd lose the $PUT and use IO$_WRITEVBLK|IO$M_NOW.  I think you can still
use the $OPEN but you'll probably want to specify UFO and then, there is
no need for the $CONNECT.  Just issues $QIO IO$_WRITEVBLK|IO$M_NOW to the
channel returned in the FAB's STV.

-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

All your spirit rack abuses, come to haunt you back by day.
All your Byzantine excuses, given time, given you away.



More information about the Info-vax mailing list