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.11 date: 2022/09/09 12:55:03
user: stefan
file: SunRPC_DemoClient.st directory: goodies/communication
module: stx stc-classLibrary: communication

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
      
  or using UDP:        

      SunRPC::DemoServer startUDP

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 toHost:hostName protocol:#tcp port:nil.
     client showOnTranscript:message.
     client close.

or using UDP:        
     |hostName client message reply|

     message := 'hello world'.
     hostName := Dialog request:'Host ?' initialAnswer:'localhost'.
     client := SunRPC::DemoClient toHost:hostName protocol:#udp port:nil.
     client showOnTranscript:message.
     client close.         

copyright

COPYRIGHT (c) 2002 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

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.

Usage example(s):

     |client messages reply|

     messages := #( 'line1' 'line2' 'line3' 'line4' ).
     client := SunRPC::DemoClient new host:'localhost' port:44400.
     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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:42:26 GMT