/// <summary>
        /// Waits for packet to be received.
        /// This method blocks execution of the current thread until a packet is received.
        /// If no packet is receive before the <paramref name="timeout"/> expires an <see cref="Exception"/> is thrown.
        /// </summary>
        /// <param name="packet">The received packet.</param>
        /// <param name="timeout">The timeout value for the reception operation to complete successfully.</param>
        /// <returns>The operation result.</returns>
        public Status Receive(out ReceivedPacket packet, TimeSpan timeout)
        {
            lock (_syncLock)
            {
                if (_initialized)
                {
                    return((Status)ReceiveNative(out packet, timeout));
                }
                else
                {
                    packet = null;

                    return(Status.ConfigurationError);
                }
            }
        }
 private extern byte ReceiveNative(out ReceivedPacket packet, TimeSpan timeout);