eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SunRPC::DemoClient':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: DemoClient (in SunRPC)


Inheritance:

   Object
   |
   +--SunRPC::RPCEndPoint
      |
      +--SunRPC::RPCClient
         |
         +--SunRPC::DemoClient

Package:
stx:goodies/communication
Category:
Net-Communication-SunRPC-Demos
Version:
rev: 1.9 date: 2017/11/18 09:55:11
user: cg
file: SunRPC_DemoClient.st directory: goodies/communication
module: stx stc-classLibrary: communication
Author:
Claus Gittinger

Description:


a simple rpc-demo client;
supports a few simple procedures: 

    showOnTranscript            - display a message on a remote transcript
    showMultipleOnTranscript    - display a collection of strings on a remote transcript    
    showPerson                  - example for a structured type object being passed
                                  and shown on a remote transcript

first, start the demoServer (on any machine) with:
      SunRPC::DemoServer start

then, connect to it, and execute a remote procedure call:

     |hostName client message reply|

     message := 'hello world'.
     hostName := Dialog request:'Host ?' initialAnswer:'localhost'.
     client := SunRPC::DemoClient new host:hostName.
     client showOnTranscript:message.
     client close.


Class protocol:

spec
o  xdr


Instance protocol:

operations
o  showMultipleOnTranscript: aStringCollection
|client messages reply|

messages := #( 'line1' 'line2' 'line3' 'line4' ).
client := SunRPC::DemoClient new host:'localhost'.
reply := client showMultipleOnTranscript:messages.
client close.
reply.

o  showOnTranscript: aString
|client message reply|

message := 'hello world'.
client := SunRPC::DemoClient new host:'localhost'.
reply := client showOnTranscript:message.
client close.
reply.

o  showPersonOnTranscript: aPerson
|client person reply|

person := Dictionary new
at:'firstName' put:'James';
at:'lastName' put:'Miller';
yourself.

client := SunRPC::DemoClient new host:'localhost'.
reply := client showPersonOnTranscript:person.
client close.
reply.



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 18 Apr 2024 07:01:57 GMT