Can I ask something? Why don't you return received data but count of this data in SendByTcp()?
|
networkStream.Write(data, 0, data.Length); |
|
int byteCount = networkStream.Read(buffer, 0, buffer.Length); |
|
|
|
return BitConverter.GetBytes(byteCount); |
But here you try to represent it like it is an answer "as-is".
|
byte[] tcpResponse = SendByTcp(address, port, basicStatMessage); |
|
|
|
if (tcpResponse.Length == 0) return new byte[] { }; |
|
return tcpResponse; |
Maybe you mean something like that?
var res = new byte[byteCount];
Buffer.BlockCopy(buffer, 0, res, 0, byteCount);
return res;
Can I ask something? Why don't you return received data but count of this data in SendByTcp()?
MCQuery/MCQuery/Connection.cs
Lines 105 to 108 in 2358706
But here you try to represent it like it is an answer "as-is".
MCQuery/MCQuery/Query.cs
Lines 68 to 71 in 2358706
Maybe you mean something like that?