} // Run() #endregion #region SendWeatherPacket() public void SendWeatherPacket() { if (mOutQueue == null) { return; } // if mOutQueue == null WeatherPacket curRecord = (WeatherPacket)mRecords.Dequeue(); mLog.Print(2, curRecord.mSerialString); IntPtr outData = Marshal.AllocHGlobal( Marshal.SizeOf(curRecord)); Marshal.StructureToPtr(curRecord, outData, true); Marshal.Copy(outData, mQueueBuf, 0, Marshal.SizeOf(curRecord)); if (mOutQueue.WriteBuffer(mQueueBuf) == false) { throw new Exception("Could not write to the output " + "queue."); } // if WriteQueue() == false } // SendWeatherPacket()