예제 #1
0
        private void SetMulticastOption(SocketOptionName optionName, MulticastOption mr)
        {
            IPMulticastRequest mreq = new IPMulticastRequest();

            mreq.MulticastAddress = GetIP4Address(mr.Group);
            if (mr.LocalAddress != null)
            {
                mreq.InterfaceAddress = GetIP4Address(mr.LocalAddress);
            }
            else
            {
                int num = IPAddress.HostToNetworkOrder(mr.InterfaceIndex);
                mreq.InterfaceAddress = num;
            }

            if (UnsafeMethods.setsockopt(Handle, SocketOptionLevel.IPv6, optionName, ref mreq, IPv6MulticastRequest.Size) ==
                SocketError.SocketError)
            {
                throw new SocketException();
            }
        }
예제 #2
0
 public static extern SocketError getsockopt([In] IntPtr socketHandle, [In] SocketOptionLevel optionLevel, [In] SocketOptionName optionName, out IPMulticastRequest optionValue, [In, Out] ref int optionLength);
예제 #3
0
 public static extern SocketError setsockopt([In] IntPtr socketHandle, [In] SocketOptionLevel optionLevel, [In] SocketOptionName optionName, [In] ref IPMulticastRequest mreq, [In] int optionLength);
예제 #4
0
 public static extern SocketError getsockopt([In] IntPtr socketHandle, [In] SocketOptionLevel optionLevel, [In] SocketOptionName optionName, out IPMulticastRequest optionValue, [In, Out] ref int optionLength);