Example #1
0
        public RelayListenerService()
        {
            var relayStateSubject = new BehaviorSubject <RelayListenerConnectionState>(RelayListenerConnectionState.Offline);

            _relayStateObservable = relayStateSubject.AsObservable();
            _relayStateObserver   = relayStateSubject.AsObserver();
        }
        internal HttpParserDelegate()
        {
            var handshakeParserStateSubject = new BehaviorSubject <ParserState>(ParserState.Start);

            _observerHandshakeParserState       = handshakeParserStateSubject.AsObserver();
            HandshakeParserCompletionObservable = handshakeParserStateSubject.AsObservable();
        }
Example #3
0
        private Device()
        {
            var deviceActivitySubject = new BehaviorSubject <DeviceActivity>(DeviceActivity.Initialized);

            _observerDeviceActivity  = deviceActivitySubject.AsObserver();
            DeviceActivityObservable = deviceActivitySubject.AsObservable();
        }
        internal HttpParserDelegate(HttpRequestResponse requestResponse)
        {
            RequestResponse = requestResponse;

            var parserStateSubject = new BehaviorSubject <ParserState>(ParserState.Start);

            _observerParserState       = parserStateSubject.AsObserver();
            ParserCompletionObservable = parserStateSubject.AsObservable();
        }
Example #5
0
        internal WebsocketParserHandler(
            IObserver <ConnectionStatus> observerConnectionStatus,
            bool subprotocolAccepted,
            bool excludeZeroApplicationDataInPong)
        {
            _handshakeParser = new HandshakeParser();
            var dataReceiveSubject = new BehaviorSubject <DataReceiveState>(DataReceiveState.Start);

            _textDataParser = new TextDataParser();

            _observerConnectionStatus = observerConnectionStatus;
            _observerDataReceiveMode  = dataReceiveSubject.AsObserver();

            SubprotocolAccepted = subprotocolAccepted;
            ExcludeZeroApplicationDataInPong = excludeZeroApplicationDataInPong;

            DataReceiveStateObservable = dataReceiveSubject.AsObservable();
        }
Example #6
0
        public MessageWebSocketRx()
        {
            var subjectMessageReceiver = new Subject <string>();

            MessageReceiverObservable = subjectMessageReceiver.AsObservable();
            _observerMessage          = subjectMessageReceiver.AsObserver();

            var subjectConnectionStatus = new BehaviorSubject <ConnectionStatus>(ConnectionStatus.Initialized);

            ConnectionStatusObservable = subjectConnectionStatus.AsObservable();
            _observerConnectionStatus  = subjectConnectionStatus.AsObserver();

            _webSocketConnectService = new WebSocketConnectHandler(_observerConnectionStatus, _observerMessage);

            _websocketParserHandler = new WebsocketParserHandler(
                _observerConnectionStatus,
                SubprotocolAccepted,
                ExcludeZeroApplicationDataInPong);

            _websocketSenderHandler = new WebsocketSenderHandler(_observerConnectionStatus);
        }