Command Manager. Use for timeout managment during reception of data Used as intermediate layer between TCP client class (Client) and application level managment of command and answers
More...
|
| ~CommandManager () |
| Releases unmanaged resources and performs other cleanup operations before the T:monitor.CommandManager is reclaimed by garbage collection. More...
|
|
void | OnMessageReception (string message, byte[] buffer) |
| Callback called by Client class after reception of new message More...
|
|
void | OnMessageTimeout (object sender, System.Timers.ElapsedEventArgs e) |
| Callback called by stopwatch on timeout More...
|
|
Command Manager. Use for timeout managment during reception of data Used as intermediate layer between TCP client class (Client) and application level managment of command and answers
Definition at line 31 of file CommandManager.cs.
◆ CommandManagerStatus
Available status when sending command
Enumerator |
---|
AnswerReceived | |
Timeout | |
Busy | |
Definition at line 63 of file CommandManager.cs.
◆ CommandManager()
Initializes a new instance of the T:monitor.CommandManager class.
- Parameters
-
callback | Callback used when new message are received |
Definition at line 74 of file CommandManager.cs.
◆ ~CommandManager()
monitor.CommandManager.~CommandManager |
( |
| ) |
|
|
private |
Releases unmanaged resources and performs other cleanup operations before the T:monitor.CommandManager is reclaimed by garbage collection.
Definition at line 86 of file CommandManager.cs.
◆ Close()
void monitor.CommandManager.Close |
( |
| ) |
|
◆ CommandReceivedEvent()
delegate void monitor.CommandManager.CommandReceivedEvent |
( |
string |
msg, |
|
|
byte [] |
buffer |
|
) |
| |
Callback for sending received data to upper level
◆ OnMessageReception()
void monitor.CommandManager.OnMessageReception |
( |
string |
message, |
|
|
byte [] |
buffer |
|
) |
| |
|
private |
Callback called by Client class after reception of new message
- Parameters
-
message | Message received from server |
buffer | Raw buffer reived from server |
Definition at line 125 of file CommandManager.cs.
◆ OnMessageTimeout()
void monitor.CommandManager.OnMessageTimeout |
( |
object |
sender, |
|
|
System.Timers.ElapsedEventArgs |
e |
|
) |
| |
|
private |
Callback called by stopwatch on timeout
- Parameters
-
sender | Sender object |
e | Information on elapsed condition |
Definition at line 156 of file CommandManager.cs.
◆ Open() [1/2]
bool monitor.CommandManager.Open |
( |
string |
hostname | ) |
|
Open the specified hostname server, using default port number.
- Returns
- true if connection succeded, false otherwise
- Parameters
-
hostname | Hostname to connect to |
Definition at line 96 of file CommandManager.cs.
◆ Open() [2/2]
bool monitor.CommandManager.Open |
( |
string |
hostname, |
|
|
int |
port |
|
) |
| |
Open connection to server "host", with port number "port"
- Returns
- true if connection succeded, false otherwise
- Parameters
-
hostname | Hostname to connect to |
port | Port number for connection |
Definition at line 107 of file CommandManager.cs.
◆ SendCommand()
CommandManagerStatus monitor.CommandManager.SendCommand |
( |
string |
cmd, |
|
|
out string |
answer, |
|
|
double |
timeout |
|
) |
| |
Sends a command to TCP server
- Returns
- status that is part of CommandManagerStatus enumerate
- Parameters
-
cmd | Command message to send to server |
answer | Answer from server, in case of acknowledge |
timeout | Timeout (ms) waiting an acknowledge, 0 if no acknowledge needed |
Definition at line 171 of file CommandManager.cs.
◆ commandReceivedEvent
◆ isBusy
bool monitor.CommandManager.isBusy = false |
|
private |
flag indicating command manager is currently busy waiting an acknowledge
Definition at line 58 of file CommandManager.cs.
◆ messageReceived
string monitor.CommandManager.messageReceived = null |
|
private |
◆ waitEvent
ManualResetEvent monitor.CommandManager.waitEvent = new ManualResetEvent(false) |
|
private |
◆ waitForAcknowledge
bool monitor.CommandManager.waitForAcknowledge = false |
|
private |
Flag to tell rogram to wait for an acknowledge from server
Definition at line 48 of file CommandManager.cs.
◆ waitTimer
System.Timers.Timer monitor.CommandManager.waitTimer = new System.Timers.Timer() |
|
private |
The documentation for this class was generated from the following file: