예제 #1
0
        private void CreateChannel()
        {
            var channel = new Channel(OnMessageReceived, OnChannelConnected, OnChannelDisconnected);

            mChannel       = channel;
            mPayloadStore  = new PayloadStore();
            mTypeInfoStore = new TypeInfoStore(typeToNotify => SendEvent(channel, new EventMessage {
                Type = typeToNotify
            }));
            mValueRenderer = new ValueRenderer(mPayloadStore, mTypeInfoStore);
            mChannel.Start();
            mStore.SinkEvents(new StoreEventSink(mChannel, mValueRenderer));
        }
예제 #2
0
        private void OnChannelDisconnected()
        {
            mConnectedEvent.Reset();

            mStore.StopMonitoringAll();
            mChannel?.Dispose();
            mChannel       = null;
            mValueRenderer = null;
            mPayloadStore  = null;
            mFirstUnsentInstrumentationIndex = 0;

            CreateChannel();
        }
 public ValueRenderer(PayloadStore store, TypeInfoStore typeInfoStore)
 {
     mStore         = store;
     mTypeInfoStore = typeInfoStore;
 }