Definition at line 29 of file BinaryRequest.cs.
Ntp.Analyzer.Monitor.Client.BinaryRequest.BinaryRequest |
( |
IPAddress |
ip, |
|
|
int |
port |
|
) |
| |
|
inline |
byte [] Ntp.Analyzer.Monitor.Client.BinaryRequest.Send |
( |
string |
command | ) |
|
|
inline |
Definition at line 36 of file BinaryRequest.cs.
38 var clientSocket =
new Socket(
39 AddressFamily.InterNetwork,
43 clientSocket.Connect(
Server);
45 byte[] sendBuffer = Encoding.UTF8.GetBytes(command);
48 clientSocket.Send(sendBuffer, 0, sendBuffer.Length, SocketFlags.None, out error);
50 const int size = 4096;
52 var stream =
new MemoryStream(size);
53 var buffer =
new byte[size];
59 length = clientSocket.Receive(buffer, 0, size, SocketFlags.None, out error);
60 stream.Write(buffer, 0, length);
63 clientSocket.Shutdown(SocketShutdown.Both);
66 return stream.ToArray();
The documentation for this class was generated from the following file: