예제 #1
0
 private void WriteCloseMessage(CloseMessage message, JsonTextWriter writer)
 {
     if (!string.IsNullOrEmpty(message.Error))
     {
         writer.WritePropertyName(ErrorPropertyName);
         writer.WriteValue(message.Error);
     }
 }
예제 #2
0
 private void WriteCloseMessage(CloseMessage message, JsonTextWriter writer)
 {
     if (message.Error != null)
     {
         writer.WritePropertyName(ErrorPropertyName);
         writer.WriteValue(message.Error);
     }
 }
예제 #3
0
        private CloseMessage BindCloseMessage(string error)
        {
            if (string.IsNullOrEmpty(error))
            {
                return(CloseMessage.Empty);
            }

            var message = new CloseMessage(error);

            return(message);
        }
예제 #4
0
        private CloseMessage BindCloseMessage(string error)
        {
            // An empty string is still an error
            if (error == null)
            {
                return(CloseMessage.Empty);
            }

            var message = new CloseMessage(error);

            return(message);
        }
 private void WriteCloseMessage(CloseMessage message, Packer packer)
 {
     packer.PackArrayHeader(2);
     packer.Pack(HubProtocolConstants.CloseMessageType);
     if (string.IsNullOrEmpty(message.Error))
     {
         packer.PackNull();
     }
     else
     {
         packer.PackString(message.Error);
     }
 }