Пример #1
0
 private static async Task MsMqSend(SimulationUnit unit)
 {
     using (var queue = new MessageQueue(unit.TargetEndpoint)) {
         Message msg = new Message {
             Body = unit.GeneratedBody, Formatter = new BinaryMessageFormatter()
         };
         queue.Send(msg);
     }
 }
Пример #2
0
 private static async Task MsMqSend(SimulationUnit unit) {
     using (var queue = new MessageQueue(unit.TargetEndpoint)) {
         Message msg = new Message { Body = unit.GeneratedBody, Formatter =  new BinaryMessageFormatter() };
         queue.Send(msg);
     }
 }
Пример #3
0
 private static async Task<HttpResponseMessage> HttpSend(SimulationUnit unit) {
     var client = new HttpClient();
     return await client.PostAsync(unit.TargetEndpoint, new StringContent(unit.GeneratedBody, Encoding.ASCII, unit.MimeType));
 }
Пример #4
0
        private static async Task <HttpResponseMessage> HttpSend(SimulationUnit unit)
        {
            var client = new HttpClient();

            return(await client.PostAsync(unit.TargetEndpoint, new StringContent(unit.GeneratedBody, Encoding.ASCII, unit.MimeType)));
        }