From: CSBVAX::MRGATE!info-vax-request@kl.sri.com@SMTP 5-MAY-1988 03:49 To: ARISIA::EVERHART Subj: Re: Trapping broadcast messages. Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Sat 30 Apr 88 14:43:01-PDT Received: by ucbvax.Berkeley.EDU (5.59/1.28) id AA25341; Sat, 30 Apr 88 06:38:46 PDT Received: from USENET by ucbvax.Berkeley.EDU with netnews for info-vax@kl.sri.com (info-vax@kl.sri.com) (contact usenet@ucbvax.Berkeley.EDU if you have questions) Date: 30 Apr 88 06:07:51 GMT From: bsu-cs!cfchiesa@iuvax.cs.indiana.edu (Christopher Chiesa) Organization: CS Dept, Ball St U, Muncie, Indiana Subject: Re: Trapping broadcast messages. Message-Id: <2819@bsu-cs.UUCP> References: <880424153816.20a00215@NMFECC.ARPA> Sender: info-vax-request@kl.sri.com To: info-vax@kl.sri.com I tried to e-mail this response, but it bounced. So be it... > I'm using smg$set_broadcast_trapping and smg$get_broadcast_message to trap > and redirect broadcast messages. Two questions about this: > > (1) Is there a way of doing this without involving SMG? (I'm not using SMG > otherwise.) > > (2) How you I determine the class of the broadcast message (OPER, SHUTDOWN, > MAIL, GENERAL, etc.)? I want to pass this information along too. > You can trap broadcast messages, and select/deselect classes of them, by passing the appropriate parameters to the $QIO system service. I've been writing a program lately, part of which does precisely this. I'll hold off posting the source (MACRO assembler; SO THERE, Michael [sorry; inside comment from the LAST time I posted MACRO code]) until/unless there's a request for it. Basically, you have to do the following: * Create a mailbox (using $CREMBX system service) * Assign a channel to the terminal, with associated mailbox (the one created above) (using $ASSIGN system service). * Set the BRDCSTMBX terminal-mode characteristic ON, and the BROADCAST terminal-mode characteristic OFF (using $QIO system service). * Optionally, select the broadcast-message classes you wish the terminal to receive, using $QIO . -- after doing all this, any broadcast messages that would normally appear on the terminal screen, will be directed to the mailbox instead. What you do with them once this is set up, is your business. Options include reading the mailbox whenever YOU are ready to look at the broadcasts, and setting a "write-attention AST" on the mailbox so that a routine you specify can be executed IMMEDIATELY when data is written to the mailbox. -- and don't forget to "clean up" all this jazz when your program executes; that means saving the original terminal characteristics for later resto- ration, for one thing... Terminal characteristics will NOT be automat- ically restored by VMS exit handlers when your image terminates. -- UUCP: !{iuvax,pur-ee,uunet}!bsu-cs!cfchiesa cfchiesa@bsu-cs.UUCP