示例#1
0
        public Endpoint Bind()
        {
            Debug.Assert(_fd != null);
            if (Network.IsMulticast((System.Net.IPEndPoint)_addr))
            {
                Network.SetReuseAddress(_fd, true);
                McastAddress = (System.Net.IPEndPoint)_addr;
                if (AssemblyUtil.IsWindows)
                {
                    //
                    // Windows does not allow binding to the mcast address itself
                    // so we bind to INADDR_ANY (0.0.0.0) instead. As a result,
                    // bi-directional connection won't work because the source
                    // address won't the multicast address and the client will
                    // therefore reject the datagram.
                    //
                    if (_addr.AddressFamily == AddressFamily.InterNetwork)
                    {
                        _addr = new System.Net.IPEndPoint(System.Net.IPAddress.Any, _port);
                    }
                    else
                    {
                        _addr = new System.Net.IPEndPoint(System.Net.IPAddress.IPv6Any, _port);
                    }
                }

                _addr = Network.DoBind(_fd, _addr);
                if (_port == 0)
                {
                    McastAddress.Port = ((System.Net.IPEndPoint)_addr).Port;
                }
                Debug.Assert(_mcastInterface != null);
                Network.SetMcastGroup(_fd, McastAddress.Address, _mcastInterface);
            }
            else
            {
                _addr = Network.DoBind(_fd, _addr);
            }
            _bound = true;
            Debug.Assert(_endpoint != null);
            _endpoint = (UdpEndpoint)_endpoint.Clone(EffectivePort());
            return(_endpoint);
        }
示例#2
0
 public static bool TryParse(string s, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Net.IPEndPoint?result)
 {
     throw null;
 }
示例#3
0
 public static bool TryParse(System.ReadOnlySpan <char> s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.IPEndPoint?result)
 {
     throw null;
 }
 public QuicConnection(System.Net.Quic.Implementations.QuicImplementationProvider implementationProvider, System.Net.EndPoint remoteEndPoint, System.Net.Security.SslClientAuthenticationOptions?sslClientAuthenticationOptions, System.Net.IPEndPoint?localEndPoint = null)
 {
 }
 public QuicConnection(System.Net.EndPoint remoteEndPoint, System.Net.Security.SslClientAuthenticationOptions?sslClientAuthenticationOptions, System.Net.IPEndPoint?localEndPoint = null)
 {
 }