Operating System - OpenVMS
1828253 Members
3544 Online
109975 Solutions
New Discussion

Re: Obtaining broadcast messages for a user

 
SOLVED
Go to solution
Tom Monaco
Occasional Advisor

Obtaining broadcast messages for a user

Is it possible to access a user's broadcast messages (i.e. from SUBMIT/NOTIFY) from a server process?

We have .NET applications that run on PCs and submit batch jobs, and I would like to forward the user's broadcast messages (job terminations, etc) back to them.

I know it is possible to route broadcast messages to a mailbox, but I don't know how to create a mailbox on behalf of a user and instruct VMS to write that user's broadcast messages into it.

Can someone point me in the right direction on how to accomplish this, or is this beyond the scope of something I can do with system calls?
7 REPLIES 7
Hein van den Heuvel
Honored Contributor
Solution

Re: Obtaining broadcast messages for a user

Well, you have to have a process running under that username with a terminal or a psuedo terminal. Then you have to:
SYS$CREMBX and assign mailbox channel
SYS$ASSIGN mailbox channel to terminal channel
QIOW (IO$_SETMODE OR IO$M_WRTATTN) to mailbox channel
QIOW SETMODE TT2$M_BRDCSTMBX

I can provide cobol, basic or C examples of that.

The critical part in this is to have a terminal. For a server job that would have to be a 'psuedo' terminal.

The SMG library routines can make the QIO work easier, but still need a terminal.
See the RTL REF MAN under SMG$ENABLE_BROACAST_TRAPPING,
SMG$DISABLE_BROACAST_TRAPPING,
SMG$GET_BROADCAST_MESSAGE.

fwiw,
Hein.

Tom Monaco
Occasional Advisor

Re: Obtaining broadcast messages for a user

Thanks, Hein.

That pretty much answers my question. I was hoping I could avoid creating a separate process for each user, but it appears that isn't the case.

I took a quick look at creating the pseudoterminal, and it looks like that gets me a device to talk to, but I still need to log into that device with username and password to associate it with the user.

Do you know if there is a way I could set up the user process and terminal without having to handle the user's password (like SUBMIT/USER= does for a batch job?)

Thanks for your help.

Tom
Tom Monaco
Occasional Advisor

Re: Obtaining broadcast messages for a user

Hi Hein,

I hate to keep replying to my own post, but I just wanted your take on the following sequence:

1) use PTD$CREATE to create a pseudoterminal
2) use SYS$PERSONA_CREATE and SYS$PERSONA_ASSUME to assume the identity of the user
3) use SYS$CREPRC and flag PRC$M_NOPASSWORD to create a process and associate it with the pseudoterminal
4) run an image that will map the broadcast messages to a mailbox using the SMG$ routines and forward the output to my server

Thanks for your help.

Tom
Ian Miller.
Honored Contributor

Re: Obtaining broadcast messages for a user

there are examples around
http://h18000.www1.hp.com/support/asktima/appl_tools/0096A6E1-E8A861C0-1C0097.html
____________________
Purely Personal Opinion
Ian Miller.
Honored Contributor

Re: Obtaining broadcast messages for a user

Hein van den Heuvel
Honored Contributor

Re: Obtaining broadcast messages for a user

Once I read the FTDRIVER doc in the VMS Drivers Ref manual a little further I started to doubt whether this in fact would work.
So I have re-posted this question in an internal HP notesfiles. I'll relay any pertinent answers here (or at least those arriving before 10/14 ).

note, In studying this matter you also want to read up on SYS$BRKTHRU, being the sending side of the messages.

Later,
Hein.
Tom Monaco
Occasional Advisor

Re: Obtaining broadcast messages for a user

Just thought I'd follow up on this.

The pseudoterminal idea worked just fine. I used the pseudoterminal output directly rather than trying to route broadcast messages into a mailbox.

I was only able to obtain broadcast messages when I created an interactive process and executed LOGINOUT as the image.

Thank you both for your help.

Tom