eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ProtocolClient':

Home

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

Class: ProtocolClient


Inheritance:

   Object
   |
   +--ProtocolClient

Package:
stx:libcompat
Category:
Network-Protocols
Version:
rev: 1.3 date: 2019/03/13 09:30:28
user: cg
file: ProtocolClient.st directory: libcompat
module: stx stc-classLibrary: libcompat

Description:


ProtocolClient is the abstract super class for a variety of network protocol clients.
It uses a stream rather than the direct network access so it could also work for streams on serial connections etc.

Structure:
	stream				stream representing the connection to and from the server
	connectInfo			information required for opening a connection
	lastResponse			remembers the last response from the server.
	progressObservers 	any object understanding #show: can be registered as a progress observer (login, transfer, etc)


Class protocol:

accessing
o  defaultPortNumber

o  logFlag

instance creation
o  openOnHost: hostIP port: portNumber

o  openOnHostNamed: hostName
If the hostname uses the colon syntax to express a certain portnumber
we use that instead of the default port number.

o  openOnHostNamed: hostName port: portNumber


Instance protocol:

accessing
o  logProgressToTranscript

o  messageText

o  response

o  stream

o  stream: aStream

actions
o  close

o  reopen

private
o  connectionInfo

o  defaultPortNumber

o  ensureConnection

o  host

o  host: hostId

o  lastResponse

o  lastResponse: aString

o  logFlag

o  logProgress: aString

o  openOnHost: hostIP port: portNumber

o  password

o  password: aString

o  pendingResponses

o  popResponse

o  port

o  port: aPortNumber

o  progressObservers

o  pushResponse: aResponse

o  resetConnectionInfo

o  user

o  user: aString

private protocol
o  checkForPendingError
If data is waiting, check it to catch any error reports.
In case the response is not an error, push it back.

o  checkResponse

o  checkResponse: aResponse onError: errorBlock onWarning: warningBlock
Get the response from the server and check for errors.
Invoke one of the blocks if an error or warning is encountered.
See class comment for classification of error codes.

o  checkResponseOnError: errorBlock onWarning: warningBlock
Get the response from the server and check for errors.
Invoke one of the blocks if an error or warning is encountered.
See class comment for classification of error codes.

o  fetchNextResponse

o  fetchPendingResponse

o  sendCommand: aString

o  sendStreamContents: aStream

private testing
o  responseIsError

o  responseIsWarning

testing
o  isConnected



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 25 Apr 2024 05:20:19 GMT