eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SunRPC::PortMapperClient':

Home

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

Class: PortMapperClient (in SunRPC)


Inheritance:

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

Package:
stx:goodies/communication
Category:
Net-Communication-SunRPC
Version:
rev: 1.19 date: 2017/11/18 09:51:02
user: cg
file: SunRPC_RPCPortMapper.st directory: goodies/communication
module: stx stc-classLibrary: communication
Author:
Claus Gittinger

Description:


interface to the portmapper; see RFC1057 and examples.


Related information:

    RFC1057

Class protocol:

constants
o  PROTO_TCP

o  PROTO_UDP

o  knownProgramNumbers

spec
o  xdr


Instance protocol:

helpers
o  protocolNumberFor: symbolicOrNumericProtocol

operations
o  callit: call_args

o  dump
return a dump-list of the portmappers state.
roughly equivalent to 'rpcinfo -p' unix command

o  getport: mapping
get the port for a (program version protocol) tuple

o  set: mapping
register a port for a (program version protocol port) tuple

o  unset: mapping
unregister a port for a (program version protocol) tuple

operations - convenient interface
o  dumpAndShow
dump the portmapper information.
roughly equivalent to 'rpcinfo -p' unix command

usage example(s):

     (self toHost:'localhost') dumpAndShow; close

o  getportForProgram: programNr version: vsnNr protocol: prot
get the port for a (program version protocol) tuple.
prot must be one of #tcp or #udp

o  setProgram: programNr version: vsnNr protocol: prot port: portNr
register a port for a (program version protocol) tuple

o  unsetProgram: programNr version: vsnNr protocol: prot
unregister a port for a (program version protocol) tuple

queries
o  portNumber

o  protocol


Examples:


Notice: windows systems have no portMapper running - you must try these on a unix box (or change 'localhost' to the name of a box running a real OS in your network). connect test:
  |mapper|

  mapper := SunRPC::PortMapperClient toHost:'localhost'.
  mapper close.
  |mapper|

  mapper := SunRPC::PortMapperClient toHost:'exeptn' protocol:#udp port:111.
  mapper close.
dump the current mapping (same as 'rpcinfo -p' command):
  |mapper|

  mapper := SunRPC::PortMapperClient toHost:'exeptn'.
  mapper dumpAndShow.
  mapper close.
dump the current mapping via udp (same as 'rpcinfo -p' command):
  |mapper|

  mapper := SunRPC::PortMapperClient toHost:'exeptn' protocol:#udp port:111.
  mapper dumpAndShow.
  mapper close.
dump the current mapping via tcp (same as 'rpcinfo -p' command):
  |mapper|

  mapper := SunRPC::PortMapperClient toHost:'exeptn' protocol:#tcp port:111.
  mapper dumpAndShow.
  mapper close.
get a mapping:
  |mapper port|

  mapper := SunRPC::PortMapperClient toHost:'localhost'.
  port := mapper getportForProgram:100000 version:2 protocol:#tcp.
  mapper close.
  Transcript showCR:port.
set a port (please validate with 'rpcinfo -p'):
  |mapper ok|

  mapper := SunRPC::PortMapperClient toHost:'localhost'.
  ok := mapper setProgram:200000 version:1 protocol:#tcp port:33333.
  mapper close.
  ok ifFalse:[self error]
unset a port (please validate with 'rpcinfo -p'):
  |mapper ok|
  mapper := SunRPC::PortMapperClient toHost:'localhost'.
  ok := mapper unsetProgram:200000 version:1 protocol:#tcp.
  mapper close.
  ok ifFalse:[self error]


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 28 Mar 2024 20:26:09 GMT