Beispiel #1
0
        private void CreateConnection(string url, Session session)
        {
            var subscriptionReaper = new SubscriptionReaper(_log, 60000);

            var eventDataResponse     = new EventDataResponse(_log);
            var eventSubscription     = new EventSubscription(_log, subscriptionReaper, eventDataResponse, _nodeCacheFactory, session, new TimeSpan(0, 60, 0));
            var dataValueSubscription = new DataValueSubscription(_log, subscriptionReaper, session, new TimeSpan(0, 10, 0));

            lock (connections)
            {
                var conn = new Connection(session, eventSubscription, dataValueSubscription, subscriptionReaper, eventDataResponse);
                connections[key : url] = conn;
                subscriptionReaper.Start();
            }
        }
Beispiel #2
0
 public void Close()
 {
     lock (this)
     {
         if (!_closed)
         {
             _closed = true;
             _subscriptionReaper.Stop();
             _subscriptionReaper.Dispose();
             DataValueSubscription.Close();
             EventSubscription.Close();
             Session.Close();
         }
     }
 }