public bool ListeningReader(byte[] data, int length, TcpTransportConnection connection)
{
Logger.Info("Received packet [size=" + length + "]");
long totalInBytes = Convert.ToInt64(inBytes.Text) + length;
Invoke(
new Action(() => { inKbps.Text = (totalInBytes / (Environment.TickCount - startTime) * 1000 / 1024).ToString(); }
));
Invoke(new Action(() => { inBytes.Text = totalInBytes.ToString(); }));
byte[] newBuffer = new byte[recvBuffer.Length + length];
Array.Copy(recvBuffer, newBuffer, recvBuffer.Length);
Array.Copy(data, 0, newBuffer, recvBuffer.Length, length);
recvBuffer = newBuffer;
int markerCount = recvBuffer.Length / marker;
int markerLength = markerCount * marker;
Invoke(
new Action(
() =>
{
md5total.Text = markerCount.ToString() + "M"; md5sum.Text = Util.getSingleton().getMD5Hash(recvBuffer, 0, markerLength);
}));
return true;
}