Esempio n. 1
0
        // RESPONSE (OUTER CALL)
        private void BytesRespondedHandler(IEnumerable <byte> data, byte prefix)
        {
            if (!_requestToRemoteSent)
            {
                _recorder.RecordError(this.GetType().Name,
                                      "Trying to receive response without outer call");
                return;
            }

            if (!_requestCalculator.ValidateCurrentIndex(prefix))
            {
                _recorder.RecordError(this.GetType().Name,
                                      "Received response with wrong index");
                return;
            }

            _requestToRemoteSent = false;

            Responded?.Invoke(data);
        }
Esempio n. 2
0
 private void TriggerResponded(IRequest request, IResponder responder)
 {
     Responded?.Invoke(this, responder, request);
 }
Esempio n. 3
0
 protected internal void OnResponded(IHttpContext context)
 {
     Task.Run(() => Responded?.Invoke(this, context));
 }
Esempio n. 4
0
 protected virtual void OnResponded(IRequest request, IResponse response) => Responded?.Invoke(request, response);
Esempio n. 5
0
 public void TriggerReceiveResponse(IEnumerable <byte> data)
 {
     Responded?.Invoke(data);
 }