コード例 #1
0
        internal virtual StreamReader GetNotBatchedAnswer(string controlUrl, Hashtable parameters)
        {
            HttpProvider provider = new HttpProvider(controlUrl);

            protLogger.Info("Opening control connection");
            if (protLogger.IsDebugEnabled)
            {
                protLogger.Debug("Control params: " + CollectionsSupport.ToString(parameters));
            }
            return(new StreamReader(provider.DoPost(parameters), Encoding.Default));
        }
コード例 #2
0
        internal virtual Stream CallResync(PushServerProxy.PushServerProxyInfo pushInfo, Lightstreamer.DotNet.Client.ConnectionConstraints newConstraints)
        {
            Hashtable parameters = new Hashtable();

            parameters["LS_session"] = pushInfo.sessionId;
            if (newConstraints != null)
            {
                this.info.constraints = (Lightstreamer.DotNet.Client.ConnectionConstraints)newConstraints.Clone();
            }
            AddConnectionProperties(parameters, this.info);
            AddConstraints(parameters, this.info.constraints);
            HttpProvider provider = new HttpProvider(pushInfo.rebindAddress + "/lightstreamer/bind_session.txt");

            protLogger.Info("Opening stream connection to rebind current session");
            if (protLogger.IsDebugEnabled)
            {
                protLogger.Debug("Rebinding params: " + CollectionsSupport.ToString(parameters));
            }
            return(provider.DoPost(parameters));
        }
コード例 #3
0
        internal virtual Stream CallSession()
        {
            Stream    stream;
            Hashtable parameters = new Hashtable();

            if (this.info.user != null)
            {
                parameters["LS_user"] = this.info.user;
            }
            if (this.info.password != null)
            {
                parameters["LS_password"] = this.info.password;
            }
            if (this.info.adapter != null)
            {
                parameters["LS_adapter"] = this.info.adapter;
            }
            AddConnectionProperties(parameters, this.info);
            AddConstraints(parameters, this.info.constraints);
            HttpProvider provider = new HttpProvider(this.info.pushServerUrl + "/lightstreamer/create_session.txt");

            protLogger.Info("Opening stream connection");
            if (protLogger.IsDebugEnabled)
            {
                protLogger.Debug("Connection params: " + CollectionsSupport.ToString(parameters));
            }
            try
            {
                stream = provider.DoPost(parameters);
            }
            catch (UriFormatException exception)
            {
                throw exception;
            }
            catch (WebException exception2)
            {
                throw exception2;
            }
            return(stream);
        }
コード例 #4
0
 internal virtual Stream CallSession()
 {
     IDictionary parameters = new Dictionary<string, string>();
     if (this.info.user != null)
     {
         parameters["LS_user"] = this.info.user;
     }
     if (this.info.password != null)
     {
         parameters["LS_password"] = this.info.password;
     }
     parameters["LS_adapter_set"] = this.info.GetAdapterSet();
     if (!(this.info.isPolling || !this.info.useGetForStreaming))
     {
         AddConnectionPropertiesForFakePolling(parameters, this.info);
     }
     else
     {
         AddConnectionProperties(parameters, this.info);
     }
     AddConstraints(parameters, this.info.constraints);
     HttpProvider provider = new HttpProvider(this.info.pushServerUrl + "/lightstreamer/create_session.txt");
     protLogger.Info("Opening stream connection");
     if (protLogger.IsDebugEnabled)
     {
         protLogger.Debug("Connection params: " + CollectionsSupport.ToString(parameters));
     }
     return provider.DoHTTP(parameters, true);
 }
コード例 #5
0
 internal virtual Stream CallResync(PushServerProxy.PushServerProxyInfo pushInfo, ConnectionConstraints newConstraints)
 {
     IDictionary parameters = new Dictionary<string, string>();
     parameters["LS_session"] = pushInfo.sessionId;
     if (newConstraints != null)
     {
         this.info.constraints = (ConnectionConstraints) newConstraints.Clone();
     }
     AddConnectionProperties(parameters, this.info);
     AddConstraints(parameters, this.info.constraints);
     HttpProvider provider = new HttpProvider(pushInfo.rebindAddress + "/lightstreamer/bind_session.txt");
     protLogger.Info("Opening stream connection to rebind current session");
     if (protLogger.IsDebugEnabled)
     {
         protLogger.Debug("Rebinding params: " + CollectionsSupport.ToString(parameters));
     }
     parameters["LS_silverlight_version"] = Constants.localVersion;
     bool flag = !this.info.isPolling && this.info.useGetForStreaming;
     return provider.DoHTTP(parameters, !flag);
 }
コード例 #6
0
ファイル: BatchManager.cs プロジェクト: psrodriguez/CIAPI.CS
 internal virtual StreamReader GetNotBatchedAnswer(string controlUrl, IDictionary parameters)
 {
     HttpProvider provider = new HttpProvider(controlUrl);
     protLogger.Info("Opening control connection");
     if (protLogger.IsDebugEnabled)
     {
         protLogger.Debug("Control params: " + CollectionsSupport.ToString(parameters));
     }
     return new StreamReader(provider.DoHTTP(parameters, true), Encoding.UTF8);
 }
コード例 #7
0
 internal virtual StreamReader GetNotBatchedAnswer(string controlUrl, Hashtable parameters)
 {
     HttpProvider provider = new HttpProvider(controlUrl);
     protLogger.Info("Opening control connection");
     if (protLogger.IsDebugEnabled)
     {
         protLogger.Debug("Control params: " + CollectionsSupport.ToString(parameters));
     }
     return new StreamReader(provider.DoPost(parameters), Encoding.Default);
 }