$title('rcvmsg - receive a simple message') $compact rcvmsg: DO; $include(:rmx:inc/rmxplm.ext) $include(dcom.ext) $include(dcom.lit) $include(:rmx:inc/error.lit) $include(err.ext) /******************************************************************** * * MODULE NAME: rcvmsg * * DESCRIPTION: Create a well-known port and wait for a message in rmx string * format. Write the message to the console, release the buffer * associated with the message and exit. * *********************************************************************/ DECLARE /* Literals */ TSTPORT LITERALLY '801H', /* well-known port */ NOEXCEPT LITERALLY '0'; /* no exception handling by system */ DECLARE /* Global vars */ status WORD, port_t TOKEN, /* Token for local port */ info rec_info, /* info block on message received */ bpool TOKEN, /* buffer pool */ b_sel SELECTOR, buf_tok TOKEN AT (@b_sel), /* token for buffer holding message */ msg_ptr POINTER; /* pointer to received message */ CALL set$exception(NOEXCEPT); port_t = get$dport(TSTPORT, @bpool, CHAIN, @status); msg_ptr = rq$receive(port_t, WAITFOREVER, @info, @status); CALL error$check(120, status); call rqc$send$eo$response(NIL, 0, msg_ptr, @status); CALL error$check(130, status); b_sel = selector$of(msg_ptr); CALL rq$release$buffer(bpool, buf_tok, (info.flags AND 3), @status); CALL error$check(140, status); CALL rq$exit$io$job(0,NIL,@status); END rcvmsg;