      subroutine plip.call(s,res,err)
*
*
*
*
*
*
*
*
*
*
      $catalog local
      $include ssock.common

      if @user4 = '0' then @user4 = ''
      if @user4 = '' then
         *$*display 'Opening rpc connection'
         call sock.connect('127.0.0.1:40400','',res,err)
         if err <> '' then
            stop err
         end
         @user4 = res
      end

      cmd.len = len(s)

      send.str = oconv(cmd.len,'mcdx') 'r%4' : oconv(cmd.len,'mcdx') 'r%4' : s
      
      call sock.write(@user4,send.str,5000,5000,err)

      if err <> '' or send.str <> '' then
         err = 'Error writing to plip.svr   err = ' : err
         res = -1
         return
      end

      s = ''
      call sock.read(@user4,cmd.len,5000,5000,'',s,err)

      if err <> '' or len(s) <> cmd.len then
         err =  'Error reading from plip.svr   err = ' : err
         res = -1
         return
      end

      s = s[9,999999999]
      if s[3,4] <> IPX.SOCKET.NO then
         err =  'Pattern match on plip.svr rpc call'
         return
      end

      err = ''
      res = oconv(s[7,4],'mcxd')
      if res > 32768 then
         res = res - 65536
      end

      return
   end
