public static CriticalAllocHandleSocketAddress FromIPAddress(IPAddress input)
 {
     if (input == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("input");
     }
     CriticalAllocHandleSocketAddress address = null;
     address = FromSize(Marshal.SizeOf(typeof(System.ServiceModel.Channels.sockaddr_in6)));
     System.ServiceModel.Channels.sockaddr_in6 structure = new System.ServiceModel.Channels.sockaddr_in6(input);
     Marshal.StructureToPtr(structure, (IntPtr) address, false);
     return address;
 }
Exemple #2
0
        public static CriticalAllocHandleSocketAddress FromIPAddress(IPAddress input)
        {
            if (input == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("input");
            }
            CriticalAllocHandleSocketAddress address = null;

            address = FromSize(Marshal.SizeOf(typeof(System.ServiceModel.Channels.sockaddr_in6)));
            System.ServiceModel.Channels.sockaddr_in6 structure = new System.ServiceModel.Channels.sockaddr_in6(input);
            Marshal.StructureToPtr(structure, (IntPtr)address, false);
            return(address);
        }