StreamingSubscriptionConnection constructor

StreamingSubscriptionConnection(
  1. ExchangeService service,
  2. int lifetime
)
Initializes a new instance of the The ExchangeService instance this connection uses to connect to the server. The maximum time, in minutes, the connection will remain open. Lifetime must be between 1 and 30.

Implementation

StreamingSubscriptionConnection(ExchangeService service, int lifetime) {
  EwsUtilities.ValidateParam(service, "service");

  EwsUtilities.ValidateClassVersion(
    service,
    ExchangeVersion.Exchange2010_SP1,
    runtimeType.toString(),
  );

  if (lifetime < 1 || lifetime > 30) {
    throw RangeError.range(lifetime, 1, 30, "lifetime");
  }

  _session = service;
  _connectionTimeout = lifetime;
}