コード例 #1
0
        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();
            }
        }
コード例 #2
0
ファイル: Corner.cs プロジェクト: fabsenet/EESSI-AS4.NET
        /// <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);
        }
コード例 #3
0
    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));
    }
コード例 #4
0
    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}");
    }
コード例 #5
0
    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}");
    }
コード例 #6
0
    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);
    }
コード例 #7
0
    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));
    }
コード例 #8
0
ファイル: SecureConfig.cs プロジェクト: ellwoods/ServiceStack
 public object Any(LargeMessage request)
 {
     return(request);
 }
コード例 #9
0
        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));
        }