Exemplo n.º 1
0
                public Native(IPv6MulticastRequest managed)
                {
                    Debug.Assert(managed.MulticastAddress.Length == MulticastAddressLength);
                    fixed(void *dest = _multicastAddress)
                    {
                        managed.MulticastAddress.CopyTo(new Span <byte>(dest, MulticastAddressLength));
                    }

                    _interfaceIndex = managed.InterfaceIndex;
                }
Exemplo n.º 2
0
 internal static extern SocketError setsockopt(
     [In] SafeSocketHandle socketHandle,
     [In] SocketOptionLevel optionLevel,
     [In] SocketOptionName optionName,
     [In] ref IPv6MulticastRequest mreq,
     [In] int optionLength);
Exemplo n.º 3
0
 internal static extern SocketError getsockopt(
     [In] SafeCloseSocket socketHandle,
     [In] SocketOptionLevel optionLevel,
     [In] SocketOptionName optionName,
     [Out] out IPv6MulticastRequest optionValue,
     [In, Out] ref int optionLength);
Exemplo n.º 4
0
 public Native(IPv6MulticastRequest managed)
 {
     Debug.Assert(managed.MulticastAddress.Length == MulticastAddressLength);
     managed.MulticastAddress.CopyTo(MemoryMarshal.CreateSpan(ref _multicastAddress[0], MulticastAddressLength));
     _interfaceIndex = managed.InterfaceIndex;
 }
Exemplo n.º 5
0
 public static Native ConvertToUnmanaged(IPv6MulticastRequest managed) => new(managed);
Exemplo n.º 6
0
        private void SetIPv6MulticastOption(SocketOptionName optionName, IPv6MulticastOption mr)
        {
            var optionValue = new IPv6MulticastRequest()
            {
                MulticastAddress = mr.Group.GetAddressBytes(),
                InterfaceIndex = (int)mr.InterfaceIndex
            };

            if (UnsafeMethods.setsockopt(Handle, SocketOptionLevel.IPv6, optionName, ref optionValue, IPv6MulticastRequest.Size) ==
                SocketError.SocketError)
            {
                throw new SocketException();
            }
        }
Exemplo n.º 7
0
 internal static partial SocketError getsockopt(
     SafeSocketHandle socketHandle,
     SocketOptionLevel optionLevel,
     SocketOptionName optionName,
     out IPv6MulticastRequest optionValue,
     ref int optionLength);