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:
Compatibility-Squeak
Version:
rev: 1.11 date: 2023/12/12 21:50:01
user: cg
file: ProtocolClient.st directory: libcompat
module: stx stc-classLibrary: libcompat

Description:


This is a dummy compatibility class, to provide a home for loaded Squeak classes
which inherit from this. It is not used in ST/X.

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

** This method must be redefined in concrete classes (subclassResponsibility) **

o  logFlag

** This method must be redefined in concrete classes (subclassResponsibility) **

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

queries
o  isAbstract
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.


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

** This method must be redefined in concrete classes (subclassResponsibility) **

o  responseIsWarning

** This method must be redefined in concrete classes (subclassResponsibility) **

testing
o  isConnected



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:37:19 GMT