static void Main(string[] args) { if (args.Length < 2) { PrintUsage(); return; } string queueFormatName = args[0]; string fileName = args[1]; LargeMessage message = new LargeMessage(new FileStream(fileName, FileMode.Open, FileAccess.Read)); LargeMessageQueue queue = new LargeMessageQueue(queueFormatName); queue.Open(); try { queue.Send(message); } finally { queue.Close(); } }
/// <summary> /// Place the given <paramref name="messageContents"/> at the Corner's location to retrieve files. /// </summary> /// <param name="value">The value.</param> /// <param name="metric">The metric.</param> /// <param name="messageContents">Content of the message to send.</param> public void PlaceLargeMessage(int value, Size metric, string messageContents) { string attachmentLocation = Path.Combine(_cornerDirectory.FullName, "messages", "attachments"); string fileLocation = LargeMessage.CreateFile(new DirectoryInfo(attachmentLocation), value, metric); messageContents = messageContents.Replace("__ATTACHMENTLOCATION__", fileLocation); PlaceMessages(messageCount: 1, messageContents: messageContents); }
static Task Data(IEndpointInstance endpointInstance) { var requestId = Guid.NewGuid(); var largeMessage = new LargeMessage { RequestId = requestId, LargeDataBus = new byte[1024 * 1024 * 5] }; Console.WriteLine($"Request sent id: {requestId}"); return(endpointInstance.Send("Samples.Unobtrusive.Server", largeMessage)); }
static async Task Data(IEndpointInstance endpointInstance) { var requestId = Guid.NewGuid(); var largeMessage = new LargeMessage { RequestId = requestId, LargeDataBus = new byte[1024 * 1024 * 5] }; await endpointInstance.Send(largeMessage) .ConfigureAwait(false); Console.WriteLine($"Request sent id: {requestId}"); }
static void Data(IBus bus) { var requestId = Guid.NewGuid(); var largeMessage = new LargeMessage { RequestId = requestId, LargeDataBus = new byte[1024 * 1024 * 5] }; bus.Send("Samples.Unobtrusive.Server", largeMessage); Console.WriteLine($"Request sent id: {requestId}"); }
static void Data(IBus bus) { var requestId = Guid.NewGuid(); var largeMessage = new LargeMessage { RequestId = requestId, LargeDataBus = new byte[1024 * 1024 * 5] }; bus.Send(largeMessage); Console.WriteLine("Request sent id: " + requestId); }
public void Can_send_large_messages() { var client = CreateClient(); IEncryptedClient encryptedClient = client.GetEncryptedClient(client.Get <string>("/publickey")); var request = new LargeMessage { Messages = 100.Times(i => new HelloSecure { Name = "Name" + i }) }; var response = encryptedClient.Send(request); Assert.That(response.Messages.Count, Is.EqualTo(request.Messages.Count)); }
public object Any(LargeMessage request) { return(request); }
public void Can_send_large_messages() { var client = CreateClient(); IEncryptedClient encryptedClient = client.GetEncryptedClient(client.Get<string>("/publickey")); var request = new LargeMessage { Messages = 100.Times(i => new HelloSecure {Name = "Name" + i}) }; var response = encryptedClient.Send(request); Assert.That(response.Messages.Count, Is.EqualTo(request.Messages.Count)); }