public void OnFilePartRequest(long offset, int size, int sequence) { if (_uploadFile != null) { byte[] data = new byte[UPLOAD_SIZE]; long read_size = _uploadFile.Read(data, (long)offset, size); if (read_size > 0) { PacketOut Out = new PacketOut((byte)Opcodes.LCR_DATA_PART); Out.WriteInt64(offset); Out.WriteInt32((int)read_size); Out.WriteInt32((int)sequence); Out.Write(data, 0, data.Length); SendTCPRaw(Out); } if (offset + size >= (long)_uploadFile.CompressedSize) { _uploadFile.Close(); _uploadFile = null; _uploading = false; ProcessFileUploadQueue(); } } }