/* Sample file for Contact/2 Pipe support */

/* - - - - - init RXU - - - - -
if rxfuncquery('rxuinit') then do */
 Call RxFuncAdd 'rxuinit','rxu','rxuinit'
 Call rxuinit
/*end*/

pipename = '\pipe\contact2'
openmode = 'WIN'
pipemode = 'WTR'
instance_count = 1
outbuf = 4096
inbuf = 4096
timeout = -1
readbufsize = 4096

dosrc = rxcreatenpipe('hpipe',pipename,openmode,pipemode,instance_count,
                     ,outbuf,inbuf,timeout)
if dosrc <> 0 then
  do
  say 'RxCreateNPipe failed with rc =' dosrc
  exit
  end

dosrc = rxconnectnpipe(hpipe)
if dosrc <> 0 then
  do
  say 'RxConnectNPipe failed with rc =' dosrc
  exit
  end

rc="0 1"
do while word(rc,1) = 0 & word(rc,2) >< 0
 rc = rxread('data',hpipe,readbufsize)
 say " - - - new data set - - "
 say data
end
