protected override async Task ProcessInternalAsync(Stream stream)
 {
     _logger.Debug("Reading acknowledgement about accepting messages to {0}", _endpoint);
     var recieveBuffer = new byte[ProtocolConstants.AcknowledgedBuffer.Length];
     await stream.ReadBytesAsync(recieveBuffer, "receive confirmation", false);
     var recieveRespone = Encoding.Unicode.GetString(recieveBuffer);
     if (recieveRespone != ProtocolConstants.Acknowledged)
     {
         _logger.Info("Response from sender acknowledgement was the wrong format", _endpoint);
         throw new InvalidAcknowledgementException();
     }
 }
Пример #2
0
 protected override async Task ProcessInternalAsync(Stream stream)
 {
     var recieveBuffer = new byte[ProtocolConstants.RecievedBuffer.Length];
     await stream.ReadBytesAsync(recieveBuffer, "receive confirmation", false);
     var recieveRespone = Encoding.Unicode.GetString(recieveBuffer);
     if (recieveRespone == ProtocolConstants.QueueDoesNotExists)
     {
         _logger.Info("Response from reciever {0} is that queue does not exists", _endpoint);
         throw new QueueDoesNotExistsException();
     }
     if (recieveRespone != ProtocolConstants.Recieved)
     {
         _logger.Info("Response from receiver {0} is not the expected one, unexpected response was: {1}",
             _endpoint, recieveRespone);
         throw new UnexpectedReceivedMessageFormatException();
     }
 }