|
Class: ProtocolClient
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
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)
accessing
-
> defaultPortNumber">defaultPortNumber
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
> logFlag">logFlag
-
** This method must be redefined in concrete classes (subclassResponsibility) **
instance creation
-
> openOnHost:port:">openOnHost: hostIP port: portNumber
-
-
> openOnHostNamed:">openOnHostNamed: hostName
-
If the hostname uses the colon syntax to express a certain portnumber
we use that instead of the default port number.
-
> openOnHostNamed:port:">openOnHostNamed: hostName port: portNumber
-
queries
-
> isAbstract">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.
accessing
-
> logProgressToTranscript">logProgressToTranscript
-
-
> messageText">messageText
-
-
> response">response
-
-
> stream">stream
-
-
> stream:">stream: aStream
-
actions
-
> close">close
-
-
> reopen">reopen
-
private
-
> connectionInfo">connectionInfo
-
-
> defaultPortNumber">defaultPortNumber
-
-
> ensureConnection">ensureConnection
-
-
> host">host
-
-
> host:">host: hostId
-
-
> lastResponse">lastResponse
-
-
> lastResponse:">lastResponse: aString
-
-
> logFlag">logFlag
-
-
> logProgress:">logProgress: aString
-
-
> openOnHost:port:">openOnHost: hostIP port: portNumber
-
-
> password">password
-
-
> password:">password: aString
-
-
> pendingResponses">pendingResponses
-
-
> popResponse">popResponse
-
-
> port">port
-
-
> port:">port: aPortNumber
-
-
> progressObservers">progressObservers
-
-
> pushResponse:">pushResponse: aResponse
-
-
> resetConnectionInfo">resetConnectionInfo
-
-
> user">user
-
-
> user:">user: aString
-
private protocol
-
> checkForPendingError">checkForPendingError
-
If data is waiting, check it to catch any error reports.
In case the response is not an error, push it back.
-
> checkResponse">checkResponse
-
-
> checkResponse:onError:onWarning:">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.
-
> checkResponseOnError:onWarning:">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.
-
> fetchNextResponse">fetchNextResponse
-
-
> fetchPendingResponse">fetchPendingResponse
-
-
> sendCommand:">sendCommand: aString
-
-
> sendStreamContents:">sendStreamContents: aStream
-
private testing
-
> responseIsError">responseIsError
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
> responseIsWarning">responseIsWarning
-
** This method must be redefined in concrete classes (subclassResponsibility) **
testing
-
> isConnected">isConnected
-
|