コード例 #1
0
 public async Task DisConnectClientById(string id)
 {
     var url       = ApiUrlManager.ApiGetUrl(ApiUrlManager.ApiMethod.Kickoff, id);
     var strResult = string.Empty;
     await requestRetryPolicy.ExecuteAction(async() =>
     {
         strResult = await HttpUtil.GetAsync(url);
     });
 }
コード例 #2
0
 public async Task DisConnectClientByStream(string app, string stream)
 {
     throw new NotImplementedException();
     var url       = ApiUrlManager.ApiGetUrl(ApiUrlManager.ApiMethod.Kickoff, app + "/" + stream);
     var strResult = string.Empty;
     await requestRetryPolicy.ExecuteAction(async() =>
     {
         strResult = await HttpUtil.GetAsync(url);
     });
 }
コード例 #3
0
 public DjLiveService(string host, string hostUrl, string userName, string password, int port = 22)
 {
     this._host     = host;
     this._hostUrl  = hostUrl;
     this._username = userName;
     this._password = password;
     _port          = port;
     _apiUrl        = hostUrl + ":1985";
     ApiUrlManager.Init(_apiUrl);
 }
コード例 #4
0
 public DjLiveService(LiveServiceConfig config)
 {
     this._host     = config.Host;
     this._hostUrl  = config.HostUrl;
     this._username = config.UserName;
     this._password = config.Password;
     _port          = config.SshPort;
     _apiPort       = config.ApiPort;
     _httpPort      = config.HttpPort;
     rtmpPort       = config.RtmpPort;
     _apiUrl        = _hostUrl + $":{_apiPort}";
     ApiUrlManager.Init(_apiUrl);
 }
コード例 #5
0
        public DjLiveService()
        {
            var reader = new System.Configuration.AppSettingsReader();

            _host     = (string)reader.GetValue("host", typeof(string));
            _hostUrl  = (string)reader.GetValue("hostUrl", typeof(string));
            _apiUrl   = (string)reader.GetValue("apiUrl", typeof(string));
            _username = (string)reader.GetValue("userName", typeof(string));
            _password = (string)reader.GetValue("password", typeof(string));
            _port     = (int)reader.GetValue("port", typeof(int));
            _apiUrl   = string.IsNullOrEmpty(_apiUrl)?_hostUrl + $":{_apiPort}" : _apiUrl;
            ApiUrlManager.Init(_apiUrl);
        }
コード例 #6
0
        public async Task <ClientRoot> GetClientInfo()
        {
            var url       = ApiUrlManager.ApiGetUrl(ApiUrlManager.ApiMethod.Clients);
            var strResult = string.Empty;
            await requestRetryPolicy.ExecuteAction(async() =>
            {
                strResult = await HttpUtil.GetAsync(url);
            });

            try
            {
                return(JsonConvert.DeserializeObject <ClientRoot>(strResult));
            }
            catch (Exception e)
            {
                //todo: log
                return(null);
            }
        }