IGLib  1.5
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
IG.Lib.Copy.ClientServerStreamBase2 Class Referenceabstract

Base class for named pipe servers and clients, contains common stuff for both. More...

+ Inheritance diagram for IG.Lib.Copy.ClientServerStreamBase2:
+ Collaboration diagram for IG.Lib.Copy.ClientServerStreamBase2:

Public Member Functions

virtual bool IsErrorResponse (string responseString)
 Returns true if the specified response string represents an error response (exception), false if not. More...
 
virtual string GetErrorMessage (string responseString)
 Returns error message that corresponds to the specified response string. More...
 
abstract void ClosePipe ()
 Closes the pipe and streams that depend on it. More...
 
abstract void CloseInput ()
 Closes the inpt stream. More...
 
abstract void CloseOutput ()
 Closes the outut stream. More...
 
abstract void ClearData ()
 Clears all the data related to servig requests (i.e. request and response strings, error flags, exceptions, etc.). More...
 
- Public Member Functions inherited from IG.Lib.Copy.ClienServerStreamBase
delegate string ResponseDelegate (string request)
 Provides an answer string to the specified request string. More...
 
void SetMessagePreix (string messagePrefix)
 Changes message prefix for the current object. More...
 
void SetMessageSeparator (char messageSeparator)
 Changes message separator for the current object. More...
 
void SetMessageFalseSeparator (char messageFalseSeparator)
 Changes message false separator for the current object. More...
 
string CreateMessage (string messageName, string[] messageArguments)
 Creates a built-in message (possibly with arguments) that is to be interpreted directly by the receiver (stream client or server) and is not executed via ordinary path. More...
 
string createResponseOrRequestString (string originalResponseOrRequestString)
 Generates request and response string in such a way that it can not be mixed up with a message. More...
 
void GetRequestOrResponse (ref string responseOrRequestString, out bool isMessage, out string messageOrCommandName, out string[] messageArguments)
 Returns the (eventually decoded) request or response string corresponding to the stirng that is read form the communication pipeline, and also parameters that specify whether the request string represents a message or not. Eventual command or message parameters are also returned. More...
 

Properties

abstract string Name [get, set]
 
static string DefaultPipeName [get, set]
 Default pipe name. More...
 
static bool DefaultIsMultilineRequest [get]
 Default pipe name. More...
 
static string DefaultRequestEnd [get]
 Default string (line) that ends any multiline request. More...
 
static bool DefaultIsMultilineResponse [get]
 Default pipe name. More...
 
static string DefaultResponseEnd [get]
 Default string (line) that ends any multiline response. More...
 
virtual bool IsMultilineRequest [get, protected set]
 Whether or not multi line requests are allowed. More...
 
string RequestEnd [get, protected set]
 
virtual bool IsMultilineResponse [get, protected set]
 Whether or not multi line responses are allowed. More...
 
string ResponseEnd [get, protected set]
 
static string DefaultErrorBegin [get]
 Default string that begins an error report. More...
 
string ErrorBegin [get, protected set]
 
abstract StreamReader InputStream [get, protected set]
 Input stream writer of the server's named pipe. More...
 
abstract StreamWriter OutputStream [get, protected set]
 Output stream reader of the server's named pipe. More...
 
bool IsError [get, protected set]
 
string RequestString [get, protected set]
 The last request string that was read from the pipe. More...
 
string ResponseString [get, protected set]
 The last answer string that was written to the pipe. More...
 
static string DefaultStopRequest [get, set]
 Default stop request string - request string that will stop the server. More...
 
string StopRequest [get, set]
 Request that causes the server stop listening and closing the pipe. More...
 
static string DefaultGenericResponse [get, set]
 Default generic response (sent in absence of any other method to generate the response). More...
 
string GenericResponse [get, protected set]
 Generic response that is sent back to the client in abscence of any method generating responses to specific requests. More...
 
static string DefaultStoppedResponse [get, set]
 Default stopped response (sent after the srver has sttopped on request). More...
 
string StoppedResponse [get, protected set]
 Stopped response that is sent back to the client after the server stops on its request. More...
 
Exception LastException [get, protected set]
 Returns the last exception thrown when serving request. More...
 
string LastErrorMessage [get, protected set]
 Returns the last error message. More...
 
string LastRequestString [get, protected set]
 Returns the last request string. More...
 
string LastResponseString [get, protected set]
 Returns the last response string. More...
 
- Properties inherited from IG.Lib.Copy.ClienServerStreamBase
object Lock [get]
 Objectt for locking the current object. More...
 
static object LockGlobal [get]
 Static lock object used by all instances of this class (and possibly by other classes). More...
 
static string DefaultMessagePrefix [get, set]
 
static char DefaultMessageSeparator [get, set]
 
static char DefaultMessageFalseSeparator [get, set]
 
string MessagePrefix [get, protected set]
 
char MessageSeparator [get, protected set]
 
char MessageFalseSeparator [get, protected set]
 
string MessagePrefixWithSeparator [get, protected set]
 Gets the mesage prefix with separator. If some string is a message, everything that follows this string until the first separator is a message name. More...
 
StringBuilder StringBuilderInternal [get]
 
static int DefaultOutputLevel [get, set]
 Default level of output for this kind of class. More...
 
virtual int OutputLevel [get, set]
 Level of output generated by operatins. More...
 
- Properties inherited from IG.Lib.ILockable
object Lock [get]
 

Private Attributes

bool _isMultilineRequest = DefaultIsMultilineRequest
 
string _requestEnd = DefaultRequestEnd
 String (line) that ends a request (only when multiline requests are allowed). More...
 
bool _isMultilineResponse = DefaultIsMultilineResponse
 
string _responseEnd = DefaultResponseEnd
 String (line) that ends a response (only when multiline responses are allowed). More...
 
string _errorBegin = DefaultErrorBegin
 String (line) that ends a response (only when multiline responses are allowed). More...
 
string _stopRequest = DefaultStopRequest
 
string _genericResponse = DefaultGenericResponse
 
string _stoppedResponse = DefaultStoppedResponse
 

Static Private Attributes

static string _defaultPipeName = "IGLibServerPipe"
 
static bool _defaultIsMultilineRequest = true
 
static string _defaultRequestEnd = "RequestEnd"
 
static bool _defaultIsMultilineResponse = true
 
static string _defaultResponseEnd = "ResponseEnd"
 
static string _defaultErrorBegin = "$$ERROR__83753093759$$: "
 
static string _defaultStopRequest = "stop"
 
static string _defaultGenericResponse = "IGLib_PipeServer_GenericResponse"
 
static string _defaultStoppedResponse = "IGLib_PipeServer_StoppedResponse"
 

Additional Inherited Members

- Public Attributes inherited from IG.Lib.Copy.ClienServerStreamBase
const int MinimalMessagePreffixLength = 3
 
- Protected Attributes inherited from IG.Lib.Copy.ClienServerStreamBase
object _lock = new object()
 

Detailed Description

Base class for named pipe servers and clients, contains common stuff for both.

$A Igor xx Mar14;

Member Function Documentation

virtual bool IG.Lib.Copy.ClientServerStreamBase2.IsErrorResponse ( string  responseString)
inlinevirtual

Returns true if the specified response string represents an error response (exception), false if not.

Parameters
responseStringResponse string that is inspected.
virtual string IG.Lib.Copy.ClientServerStreamBase2.GetErrorMessage ( string  responseString)
inlinevirtual

Returns error message that corresponds to the specified response string.

Exception is thrown if the response string does not represent an error response.

Parameters
responseStringResponse string for which erro message is returned.
abstract void IG.Lib.Copy.ClientServerStreamBase2.ClosePipe ( )
pure virtual

Closes the pipe and streams that depend on it.

Implemented in IG.Lib.Copy.NamedPipeClientBase, and IG.Lib.Copy.NamedPipeServerBase.

abstract void IG.Lib.Copy.ClientServerStreamBase2.CloseInput ( )
pure virtual

Closes the inpt stream.

Implemented in IG.Lib.Copy.ClientStreamBase, and IG.Lib.Copy.ServerStreamBase.

abstract void IG.Lib.Copy.ClientServerStreamBase2.CloseOutput ( )
pure virtual

Closes the outut stream.

Implemented in IG.Lib.Copy.ClientStreamBase, and IG.Lib.Copy.ServerStreamBase.

abstract void IG.Lib.Copy.ClientServerStreamBase2.ClearData ( )
pure virtual

Clears all the data related to servig requests (i.e. request and response strings, error flags, exceptions, etc.).

Implemented in IG.Lib.Copy.ClientStreamBase, and IG.Lib.Copy.ServerStreamBase.

Member Data Documentation

string IG.Lib.Copy.ClientServerStreamBase2._defaultPipeName = "IGLibServerPipe"
staticprivate
bool IG.Lib.Copy.ClientServerStreamBase2._defaultIsMultilineRequest = true
staticprivate
string IG.Lib.Copy.ClientServerStreamBase2._defaultRequestEnd = "RequestEnd"
staticprivate
bool IG.Lib.Copy.ClientServerStreamBase2._defaultIsMultilineResponse = true
staticprivate
string IG.Lib.Copy.ClientServerStreamBase2._defaultResponseEnd = "ResponseEnd"
staticprivate
bool IG.Lib.Copy.ClientServerStreamBase2._isMultilineRequest = DefaultIsMultilineRequest
private
string IG.Lib.Copy.ClientServerStreamBase2._requestEnd = DefaultRequestEnd
private

String (line) that ends a request (only when multiline requests are allowed).

bool IG.Lib.Copy.ClientServerStreamBase2._isMultilineResponse = DefaultIsMultilineResponse
private
string IG.Lib.Copy.ClientServerStreamBase2._responseEnd = DefaultResponseEnd
private

String (line) that ends a response (only when multiline responses are allowed).

string IG.Lib.Copy.ClientServerStreamBase2._defaultErrorBegin = "$$ERROR__83753093759$$: "
staticprivate
string IG.Lib.Copy.ClientServerStreamBase2._errorBegin = DefaultErrorBegin
private

String (line) that ends a response (only when multiline responses are allowed).

string IG.Lib.Copy.ClientServerStreamBase2._defaultStopRequest = "stop"
staticprivate
string IG.Lib.Copy.ClientServerStreamBase2._stopRequest = DefaultStopRequest
private
string IG.Lib.Copy.ClientServerStreamBase2._defaultGenericResponse = "IGLib_PipeServer_GenericResponse"
staticprivate
string IG.Lib.Copy.ClientServerStreamBase2._genericResponse = DefaultGenericResponse
private
string IG.Lib.Copy.ClientServerStreamBase2._defaultStoppedResponse = "IGLib_PipeServer_StoppedResponse"
staticprivate
string IG.Lib.Copy.ClientServerStreamBase2._stoppedResponse = DefaultStoppedResponse
private

Property Documentation

abstract string IG.Lib.Copy.ClientServerStreamBase2.Name
getset
string IG.Lib.Copy.ClientServerStreamBase2.DefaultPipeName
staticgetset

Default pipe name.

bool IG.Lib.Copy.ClientServerStreamBase2.DefaultIsMultilineRequest
staticget

Default pipe name.

string IG.Lib.Copy.ClientServerStreamBase2.DefaultRequestEnd
staticget

Default string (line) that ends any multiline request.

bool IG.Lib.Copy.ClientServerStreamBase2.DefaultIsMultilineResponse
staticget

Default pipe name.

string IG.Lib.Copy.ClientServerStreamBase2.DefaultResponseEnd
staticget

Default string (line) that ends any multiline response.

virtual bool IG.Lib.Copy.ClientServerStreamBase2.IsMultilineRequest
getprotected set

Whether or not multi line requests are allowed.

string IG.Lib.Copy.ClientServerStreamBase2.RequestEnd
getprotected set
virtual bool IG.Lib.Copy.ClientServerStreamBase2.IsMultilineResponse
getprotected set

Whether or not multi line responses are allowed.

string IG.Lib.Copy.ClientServerStreamBase2.ResponseEnd
getprotected set
string IG.Lib.Copy.ClientServerStreamBase2.DefaultErrorBegin
staticget

Default string that begins an error report.

string IG.Lib.Copy.ClientServerStreamBase2.ErrorBegin
getprotected set
abstract StreamReader IG.Lib.Copy.ClientServerStreamBase2.InputStream
getprotected set

Input stream writer of the server's named pipe.

abstract StreamWriter IG.Lib.Copy.ClientServerStreamBase2.OutputStream
getprotected set

Output stream reader of the server's named pipe.

bool IG.Lib.Copy.ClientServerStreamBase2.IsError
getprotected set
string IG.Lib.Copy.ClientServerStreamBase2.RequestString
getprotected set

The last request string that was read from the pipe.

string IG.Lib.Copy.ClientServerStreamBase2.ResponseString
getprotected set

The last answer string that was written to the pipe.

string IG.Lib.Copy.ClientServerStreamBase2.DefaultStopRequest
staticgetset

Default stop request string - request string that will stop the server.

string IG.Lib.Copy.ClientServerStreamBase2.StopRequest
getset

Request that causes the server stop listening and closing the pipe.

string IG.Lib.Copy.ClientServerStreamBase2.DefaultGenericResponse
staticgetset

Default generic response (sent in absence of any other method to generate the response).

string IG.Lib.Copy.ClientServerStreamBase2.GenericResponse
getprotected set

Generic response that is sent back to the client in abscence of any method generating responses to specific requests.

string IG.Lib.Copy.ClientServerStreamBase2.DefaultStoppedResponse
staticgetset

Default stopped response (sent after the srver has sttopped on request).

string IG.Lib.Copy.ClientServerStreamBase2.StoppedResponse
getprotected set

Stopped response that is sent back to the client after the server stops on its request.

Exception IG.Lib.Copy.ClientServerStreamBase2.LastException
getprotected set

Returns the last exception thrown when serving request.

string IG.Lib.Copy.ClientServerStreamBase2.LastErrorMessage
getprotected set

Returns the last error message.

string IG.Lib.Copy.ClientServerStreamBase2.LastRequestString
getprotected set

Returns the last request string.

string IG.Lib.Copy.ClientServerStreamBase2.LastResponseString
getprotected set

Returns the last response string.


The documentation for this class was generated from the following file: