public static bool TryCreate(Uri url, out IStunIceServer stunIceServer)
    {
      try
      {
        stunIceServer = new StunIceServer(url);
      }
      catch (Exception)
      {
        stunIceServer = null;
        return false;
      }

      return true;
    }
        public static bool TryCreate(Uri url, out IStunIceServer stunIceServer)
        {
            try
            {
                stunIceServer = new StunIceServer(url);
            }
            catch (Exception)
            {
                stunIceServer = null;
                return(false);
            }

            return(true);
        }
예제 #3
0
        private async Task <ServerReflexiveIceCandidate> FindServerReflexiveUdpIceCandidate(IStunIceServer stunIceServer)
        {
            var hostNameAndPort = await Stun.Stun.Bind(new HostName("stun.l.google.com"), 19302);

            return(new ServerReflexiveIceCandidate(0, 1, 0, hostNameAndPort.Item1, hostNameAndPort.Item2));
        }
 private async Task<ServerReflexiveIceCandidate> FindServerReflexiveUdpIceCandidate(IStunIceServer stunIceServer)
 {
   var hostNameAndPort = await Stun.Stun.Bind(new HostName("stun.l.google.com"), 19302);
   return new ServerReflexiveIceCandidate(0, 1, 0, hostNameAndPort.Item1, hostNameAndPort.Item2);
 }