protected override int ProcessIncoming(NetContext context, Connection connection, System.IO.Stream incomingBuffer) { if (incomingBuffer.Length < 4) return 0; byte[] length = new byte[4]; NetContext.Fill(incomingBuffer, length, 4); int len = (length[0] << 24) | (length[1] << 16) | (length[2] << 8) | (length[3]); if (incomingBuffer.Length < len + 4) return 0; byte[] blob = new byte[len]; NetContext.Fill(incomingBuffer, blob, len); context.Handler.OnReceived(connection, blob); return len + 4; }