Пример #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));
        }
        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));
        }
        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 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);
 }