Base class for client and server classes with stream-based communication.
More...
|
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...
|
|
|
object | _lock = new object() |
|
|
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...
|
|
object | Lock [get] |
|
Base class for client and server classes with stream-based communication.
$A Igor xx Aug14;
delegate string IG.Lib.Copy.ClienServerStreamBase.ResponseDelegate |
( |
string |
request | ) |
|
Provides an answer string to the specified request string.
- Parameters
-
- 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
-
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. |
object IG.Lib.Copy.ClienServerStreamBase._lock = new object() |
|
protected |
object IG.Lib.Copy.ClienServerStreamBase._lockGlobal = null |
|
staticprivate |
const int IG.Lib.Copy.ClienServerStreamBase.MinimalMessagePreffixLength = 3 |
string IG.Lib.Copy.ClienServerStreamBase._defaultMessagePrefix = "IGLibMessage" |
|
staticprivate |
char IG.Lib.Copy.ClienServerStreamBase._defaultMessageSeparator = '_' |
|
staticprivate |
char IG.Lib.Copy.ClienServerStreamBase._defaultMessageFalseSeparator = '.' |
|
staticprivate |
string IG.Lib.Copy.ClienServerStreamBase._messagePrefixWithSeparator = null |
|
private |
StringBuilder IG.Lib.Copy.ClienServerStreamBase._sb = new StringBuilder() |
|
private |
int IG.Lib.Copy.ClienServerStreamBase._defatultOutputLevel = 1 |
|
staticprivate |
object IG.Lib.Copy.ClienServerStreamBase.Lock |
|
get |
Objectt for locking the current object.
object IG.Lib.Copy.ClienServerStreamBase.LockGlobal |
|
staticget |
Static lock object used by all instances of this class (and possibly by other classes).
string IG.Lib.Copy.ClienServerStreamBase.DefaultMessagePrefix |
|
staticgetset |
char IG.Lib.Copy.ClienServerStreamBase.DefaultMessageSeparator |
|
staticgetset |
char IG.Lib.Copy.ClienServerStreamBase.DefaultMessageFalseSeparator |
|
staticgetset |
string IG.Lib.Copy.ClienServerStreamBase.MessagePrefix |
|
getprotected set |
char IG.Lib.Copy.ClienServerStreamBase.MessageSeparator |
|
getprotected set |
char IG.Lib.Copy.ClienServerStreamBase.MessageFalseSeparator |
|
getprotected set |
string IG.Lib.Copy.ClienServerStreamBase.MessagePrefixWithSeparator |
|
getprotected 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 |
|
getprotected |
int IG.Lib.Copy.ClienServerStreamBase.DefaultOutputLevel |
|
staticgetset |
Default level of output for this kind of class.
virtual int IG.Lib.Copy.ClienServerStreamBase.OutputLevel |
|
getset |
Level of output generated by operatins.
The documentation for this class was generated from the following file: