Hi folks.
I've got a DECnet nontransparent task-to-task problem. I'm
trying to write a routine to accept incoming connection
requests, but I want to start the program manually in
advance of the request coming in. The routine will be an
alternative to a similar item which uses UCX via berkeley
sockets, but not the auxiliary server. An incoming argument
will say which net type is in use. It will have to run
on both VAX and Alpha, and just about every version of VMS
from 5.5-2 upwards.
The code I've generated from my understanding of the DECnet
manual does the following:
1) Create a mailbox.
2) Assigns a channel to "_NET:", with the mailbox attatched.
3) Issues a QIO with IO$_ACPCONTROL.
4) Posts a read on the mailbox.
5) Uses the NCB in the mailbox to accept the connection.
I get an access violation out of step 2 which makes me think
it's expecting its "_NET:" device to have been created by
DECnet in response to an incoming call it's already got.
I hope that I've just misunderstood the manual.
Is there a way to do what I'm trying to do, and if so could
you give me either a noddy example (ideally in "C") or a
list of the steps I should be coding?
Cheers,
This works for us
--------------------------------------------------------------------------------
#include
#include
#include
int main()
{
long netdesc[2];
long mbxlognam[2];
int sts;
short mbxchan, netchan;
mbxlognam[1] = (long) "MyMailbox!";
mbxlognam[0] = strlen(mbxlognam[1]);
sts = sys$crembx(0, &mbxchan, 0, 0, 0, 0, mbxlognam, 0, 0);
printf("$CREMBX status %X\n", sts);
if (!(sts&1)) exit(sts);
netdesc[1] = (long) "_NET:";
netdesc[0] = strlen(netdesc[1]);
sts = sys$assign(netdesc, &netchan, 0, mbxlognam, 0);
printf("$ASSIGN status %X\n", sts);
exit(sts);
}