| IGLib 1.5 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Public Attributes | Protected Attributes | Properties | Private Attributes | Static Private Attributes | List of all members
IG.Lib.Copy.ClienServerStreamBase Class Reference

Base class for client and server classes with stream-based communication. More...

Inheritance diagram for IG.Lib.Copy.ClienServerStreamBase:
[legend]
Collaboration diagram for IG.Lib.Copy.ClienServerStreamBase:
[legend]

## Public Member Functions
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...

## Public Attributes
const int | MinimalMessagePreffixLength = 3

## Protected Attributes
object | _lock = new object()

## Properties
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
string | _messagePrefix = DefaultMessagePrefix
char | _messageSeparator = DefaultMessageSeparator
char | _messageFalseSeparator = DefaultMessageFalseSeparator
string | _messagePrefixWithSeparator = null
StringBuilder | _sb = new StringBuilder()
int | _otputLevel = DefaultOutputLevel

## Static Private Attributes
static object | _lockGlobal = null
static string | _defaultMessagePrefix = "IGLibMessage"
static char | _defaultMessageSeparator = '_'
static char | _defaultMessageFalseSeparator = '.'
static int | _defatultOutputLevel = 1

## Detailed Description

Base class for client and server classes with stream-based communication.

$A Igor xx Aug14;

## Member Function Documentation

delegate string IG.Lib.Copy.ClienServerStreamBase.ResponseDelegate | ( | string | request | ) |

Provides an answer string to the specified request string.

Parameters

  request | Request string.

Returns
  Answer to the request.

void IG.Lib.Copy.ClienServerStreamBase.SetMessagePreix | ( | string | messagePrefix | ) |
| inline

Changes message prefix for the current object.

This setter method is provided in order to keep the MessagePrefix setter protected.

Parameters

  messagePrefix | New message prefix. Must be at least MinimalMessagePreffixLength characters long.

void IG.Lib.Copy.ClienServerStreamBase.SetMessageSeparator | ( | char | messageSeparator | ) |
| inline

Changes message separator for the current object.

This setter method is provided in order to keep the MessageSeparator setter protected.

Parameters

  messagePrefix | New message separator must not be a separator or a white space character.

void IG.Lib.Copy.ClienServerStreamBase.SetMessageFalseSeparator | ( | char | messageFalseSeparator | ) |
| inline

Changes message false separator for the current object.

This setter method is provided in order to keep the MessageFalseSeparator setter protected.

Parameters

  messagePrefix | New message false separator must not be a separator or a white space character.

string IG.Lib.Copy.ClienServerStreamBase.CreateMessage | ( | string | messageName,
|  | string[] | messageArguments
| ) |  |
| inline

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.

Messages commands are composed of message prefix, separator (jointly MessagePrefixWithSeparator), and message name. The first two are fixed parts whire the latter varies and defines the message.

Parameters

  messageName | Name of the message (a kind of command name).
  messageArguments | Optional arguments of the message.

Returns

string IG.Lib.Copy.ClienServerStreamBase.createResponseOrRequestString | ( | string | originalResponseOrRequestString | ) |
| inline

Generates request and response string in such a way that it can not be mixed up with a message.

If the original string begins with the message prefix theen a false separator is inserted after the part that is the same as message prefix. In this way the string can be distinguished form a message and can be correctly decoded on the other side of the communication pipeline (simply by removng the false separator).

Parameters

  originalResponseOrRequestString | Original response string that is sent to the other side.

Returns
  The created request string that can be distinguished form a command.

void IG.Lib.Copy.ClienServerStreamBase.GetRequestOrResponse | ( | ref string | responseOrRequestString,
|  | out bool | isMessage,
|  | out string | messageOrCommandName,
|  | out string[] | messageArguments
| ) |  |
| inline

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.

Parameters

  responseOrRequestString | Original response or request string that is to be decoded.
  isMessage | Output flag telling whether the string is a message or not.
  messageOrCommandName | Name of the message or command extracted from the string.
  messageArguments | Message or command arguments.

## Member Data Documentation

object IG.Lib.Copy.ClienServerStreamBase._lock = new object()
| protected

object IG.Lib.Copy.ClienServerStreamBase._lockGlobal = null
| static private

const int IG.Lib.Copy.ClienServerStreamBase.MinimalMessagePreffixLength = 3

string IG.Lib.Copy.ClienServerStreamBase._defaultMessagePrefix = "IGLibMessage"
| static private

char IG.Lib.Copy.ClienServerStreamBase._defaultMessageSeparator = '_'
| static private

char IG.Lib.Copy.ClienServerStreamBase._defaultMessageFalseSeparator = '.'
| static private

string IG.Lib.Copy.ClienServerStreamBase._messagePrefix = DefaultMessagePrefix
| private

char IG.Lib.Copy.ClienServerStreamBase._messageSeparator = DefaultMessageSeparator
| private

char IG.Lib.Copy.ClienServerStreamBase._messageFalseSeparator = DefaultMessageFalseSeparator
| private

string IG.Lib.Copy.ClienServerStreamBase._messagePrefixWithSeparator = null
| private

StringBuilder IG.Lib.Copy.ClienServerStreamBase._sb = new StringBuilder()
| private

int IG.Lib.Copy.ClienServerStreamBase._defatultOutputLevel = 1
| static private

int IG.Lib.Copy.ClienServerStreamBase._otputLevel = DefaultOutputLevel
| private

## Property Documentation

object IG.Lib.Copy.ClienServerStreamBase.Lock
| get

Objectt for locking the current object.

object IG.Lib.Copy.ClienServerStreamBase.LockGlobal
| static get

Static lock object used by all instances of this class (and possibly by other classes).

string IG.Lib.Copy.ClienServerStreamBase.DefaultMessagePrefix
| static get set

char IG.Lib.Copy.ClienServerStreamBase.DefaultMessageSeparator
| static get set

char IG.Lib.Copy.ClienServerStreamBase.DefaultMessageFalseSeparator
| static get set

string IG.Lib.Copy.ClienServerStreamBase.MessagePrefix
| get protected set

char IG.Lib.Copy.ClienServerStreamBase.MessageSeparator
| get protected set

char IG.Lib.Copy.ClienServerStreamBase.MessageFalseSeparator
| get protected set

string IG.Lib.Copy.ClienServerStreamBase.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.

A protected getter is defined that is only allowed to set the property to null (invalidate it). If a non-null value is set then an exception is thrown.

StringBuilder IG.Lib.Copy.ClienServerStreamBase.StringBuilderInternal
| get protected

int IG.Lib.Copy.ClienServerStreamBase.DefaultOutputLevel
| static get set

Default level of output for this kind of class.

virtual int IG.Lib.Copy.ClienServerStreamBase.OutputLevel
| get set

Level of output generated by operatins.

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

- igbase/data/streams/streams_copy/ClientServerStreamBase_Copy.cs