internal void Set(OnQueryNATTypeCompleteInfoInternal?other)
 {
     if (other != null)
     {
         ResultCode = other.Value.ResultCode;
         ClientData = other.Value.ClientData;
         NATType    = other.Value.NATType;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Get our last-queried NAT-type, if it has been successfully queried.
        /// </summary>
        /// <param name="options">Information about what version of the <see cref="GetNATType" /> API is supported</param>
        /// <param name="outNATType">The queried NAT Type, or unknown if unknown</param>
        /// <returns>
        /// <see cref="Result" />::<see cref="Result.Success" /> - if we have cached data
        /// <see cref="Result" />::<see cref="Result.NotFound" /> - If we do not have queried data cached
        /// </returns>
        public Result GetNATType(GetNATTypeOptions options, out NATType outNATType)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <GetNATTypeOptionsInternal, GetNATTypeOptions>(ref optionsAddress, options);

            outNATType = Helper.GetDefault <NATType>();

            var funcResult = EOS_P2P_GetNATType(InnerHandle, optionsAddress, ref outNATType);

            Helper.TryMarshalDispose(ref optionsAddress);

            return(funcResult);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get our last-queried NAT-type, if it has been successfully queried.
        /// </summary>
        /// <param name="options">Information about what version of the <see cref="GetNATType" /> API is supported</param>
        /// <param name="outNATType">The queried NAT Type, or unknown if unknown</param>
        /// <returns>
        /// <see cref="Result" />::<see cref="Result.Success" /> - if we have cached data
        /// <see cref="Result" />::<see cref="Result.NotFound" /> - If we do not have queried data cached
        /// </returns>
        public Result GetNATType(GetNATTypeOptions options, out NATType outNATType)
        {
            var optionsInternal = Helper.CopyProperties <GetNATTypeOptionsInternal>(options);

            outNATType = Helper.GetDefault <NATType>();

            var funcResult = EOS_P2P_GetNATType(InnerHandle, ref optionsInternal, ref outNATType);

            Helper.TryMarshalDispose(ref optionsInternal);

            var funcResultReturn = Helper.GetDefault <Result>();

            Helper.TryMarshalGet(funcResult, out funcResultReturn);
            return(funcResultReturn);
        }
Ejemplo n.º 4
0
 internal static extern Result EOS_P2P_GetNATType(System.IntPtr handle, System.IntPtr options, ref NATType outNATType);
Ejemplo n.º 5
0
 private static extern Result EOS_P2P_GetNATType(IntPtr handle, ref GetNATTypeOptionsInternal options, ref NATType outNATType);