Static class for TCP client
More...
|
static bool | Open (string host) |
| Open connection to server "host", on default port number. More...
|
|
static bool | Open (string host, int port) |
| Open connection to server "host", with port number "port" More...
|
|
static void | Close () |
| Close connection to server More...
|
|
static void | Write (string mes) |
| Write a string to server More...
|
|
|
static void | ReadCallback (IAsyncResult ar) |
| Callback call by stream.BeginRead after reception of newLength data More...
|
|
Static class for TCP client
Definition at line 31 of file Client.cs.
◆ Close()
static void monitor.Client.Close |
( |
| ) |
|
|
static |
Close connection to server
Definition at line 141 of file Client.cs.
◆ Open() [1/2]
static bool monitor.Client.Open |
( |
string |
host | ) |
|
|
static |
Open connection to server "host", on default port number.
- Returns
- true if connection succeded, false otherwise
- Parameters
-
host | Hostname to connect to |
Definition at line 89 of file Client.cs.
◆ Open() [2/2]
static bool monitor.Client.Open |
( |
string |
host, |
|
|
int |
port |
|
) |
| |
|
static |
Open connection to server "host", with port number "port"
- Returns
- true if connection succeded, false otherwise
- Parameters
-
host | Hostname to connect to |
port | Port number for connection |
Definition at line 100 of file Client.cs.
◆ ReadCallback()
static void monitor.Client.ReadCallback |
( |
IAsyncResult |
ar | ) |
|
|
staticprivate |
Callback call by stream.BeginRead after reception of newLength data
- Parameters
-
ar | Not sure of what is it, but needed for terminate reading |
Definition at line 151 of file Client.cs.
◆ ReadEvent()
delegate void monitor.Client.ReadEvent |
( |
string |
msg, |
|
|
byte [] |
buffer |
|
) |
| |
Callback to send received message to upper level
◆ Write()
static void monitor.Client.Write |
( |
string |
mes | ) |
|
|
static |
Write a string to server
- Returns
- Nothing
- Parameters
-
mes | Message to send to server |
Definition at line 219 of file Client.cs.
◆ buffer
Internal buffer used when reading data from server
Definition at line 61 of file Client.cs.
◆ BufferMaxSize
const int monitor.Client.BufferMaxSize = 512 |
|
private |
Size of internal buffer used when reading data from server
Definition at line 56 of file Client.cs.
◆ client
TcpClient monitor.Client.client = null |
|
staticprivate |
Tcp client object
Definition at line 46 of file Client.cs.
◆ defaultIP
const string monitor.Client.defaultIP = "localhost" |
Default server name
Definition at line 36 of file Client.cs.
◆ defaultPort
const int monitor.Client.defaultPort = 4500 |
Default server port number
Definition at line 41 of file Client.cs.
◆ initialReceiveBufferIndex
int monitor.Client.initialReceiveBufferIndex = 0 |
|
staticprivate |
◆ message
StringBuilder monitor.Client.message = new StringBuilder() |
|
staticprivate |
String containing received message from tcp server
Definition at line 74 of file Client.cs.
◆ newLength
int monitor.Client.newLength = 1 |
|
staticprivate |
◆ packetCounter
int monitor.Client.packetCounter = 0 |
|
staticprivate |
◆ readEvent
◆ receiveBuffer
byte [] monitor.Client.receiveBuffer |
|
staticprivate |
buffer containing received message from TCP server Used to concatenate internal buffers into one
Definition at line 67 of file Client.cs.
◆ stream
NetworkStream monitor.Client.stream = null |
|
staticprivate |
Stream object used for communication
Definition at line 51 of file Client.cs.
The documentation for this class was generated from the following file: