Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!gatech!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!iuvax!bsu-cs!cfchiesa From: cfchiesa@bsu-cs.UUCP (Christopher Chiesa) Newsgroups: comp.os.vms Subject: Re: Trapping broadcast messages. Summary: Trapping broadcasts without SMG Message-ID: <2819@bsu-cs.UUCP> Date: 30 Apr 88 06:07:51 GMT References: <880424153816.20a00215@NMFECC.ARPA> Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 48 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