I was just looking at the OSI reference model
(http://www.whatis.com/osifig.htm) and see that in the Transport
layer, User Datagram Protocol (UDP) is used to move Remote Procedure
Calls (RPCs) from one app to another. Since we can now use UDP sockets
in MC, what would a MC RPC look like? Suppose you have stack A running
on one server, and stack B on another. What's the process? (I've
started list of steps below.)


- Stack B:
    local tRpcPort

    on openStack
      put <RPC port number from config file> into tRpcPort
      accept datagram connections \
            on port tRpcPort \
            with message "IncomingRPC"
    end openStack


- Stack A:
    local tRpcPort

    on openStack
      put <RPC port number from config file> into tRpcPort
      accept datagram connections \
            on port tRpcPort \
            with message "IncomingRPC"
    end openStack

    on askTime
      put <stack B IP addr from config file> into tAddressStackB
      open datagram socket to (tAddressStackB & colon & tRpcPort)
      write "whatTimeIsIt" \
            to (tAddressStackB & colon & tRpcPort)
      close socket tRpcPort
    end askTime


- Stack B:
    local tClientAddress, tRpcPort

    on IncomingRPC pAddressOfSender, pSentData
      put pAddressOfSender into tClientAddress
      -- is the socket already open? Or do I open it here?
      read from socket tRpcPort with message pSentData
      close socket tRpcPort
    end IncomingRPC

    on WhatTimeIsIt
      open datagram socket to (tClientAddress & colon & tRpcPort)
      set the twelveHourTime to false
      write (the short date && the long time) \
            to (tClientAddress & colon & tRpcPort)
      close socket tRpcPort
    end WhatTimeIsIt


- Stack A:
(it receives the answer in a manner similar to the way Stack B
received the "WhatTimeIsIt" request - I don't have time to flesh out
the code.)

Any corrections or improvements will be appreciated.

-- 
Phil Davis
------------------
[EMAIL PROTECTED]

This is the MetaCard mailing list.
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm

Reply via email to