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); }
internal virtual void CallConstrainRequest(PushServerProxy.PushServerProxyInfo pushInfo, ConnectionConstraints newConstraints) { IDictionary parameters = new Dictionary<string, string>(); parameters["LS_session"] = pushInfo.sessionId; parameters["LS_op"] = "constrain"; this.info.constraints = (ConnectionConstraints) newConstraints.Clone(); AddConstraints(parameters, this.info.constraints); string controlUrl = pushInfo.controlAddress + "/lightstreamer/control.txt"; StreamReader notBatchedAnswer = this.batchManager.GetNotBatchedAnswer(controlUrl, parameters); try { this.CheckAnswer(notBatchedAnswer); } catch (PushEndException) { throw new PushServerException(7); } finally { try { streamLogger.Debug("Closing constrain connection"); notBatchedAnswer.Close(); } catch (IOException exception) { streamLogger.Debug("Error closing constrain connection", exception); } } }