while (_shouldRun)
{
// .. the below is in another method, but this is the idea
using (var reader = new BinaryReader(_receiveStream, encoding, true))
{
identifier = reader.ReadUInt16();
ushort lenght = reader.ReadUInt16();
data = reader.ReadBytes(lenght);
}
}
while (_shouldRun)
{
// .. the below is in another method, but this is the idea
using (var reader = new BinaryReader(_receiveStream, encoding, true))
{
identifier = reader.ReadUInt16();
ushort lenght = reader.ReadUInt16();
data = reader.ReadBytes(lenght);
}
}