[Mono-list] Large messages over NetTcpBinding

Miguel de Icaza miguel at xamarin.com
Sat Nov 12 15:58:47 EST 2011


Hello,

    Thanks for the sample;   A quick fix for you is to remove the hardcoded
value.

    I have not been able to figure out how to get the information from the
NetTcpBinding (which contains the MaxReceivedMessageSize property) down to
the TcpBinaryFrameManager

Miguel

On Fri, Nov 11, 2011 at 6:48 AM, wuffus <w.schwarz at odoscope.com> wrote:

> Yes, it runs under Windows.
> Here a minimal example:
>
> Server:
>
> using System;
> using System.IO;
> using System.ServiceModel;
>
> namespace nettcptest
> {
>    [ServiceContract]
>    interface ITest
>    {
>        [OperationContract]
>        Stream test();
>    }
>
>    public class Test : ITest
>    {
>        public Stream test()
>        {
>            byte[] b=new byte[100000];
>            MemoryStream str = new MemoryStream(b);
>            return str;
>        }
>    }
>
>    class Program
>    {
>        static void Main(string[] args)
>        {
>            Uri uri = new Uri("net.tcp://localhost:3000");
>            ServiceHost host = new ServiceHost(typeof(Test),uri);
>            host.Open();
>            Console.Read();
>        }
>    }
> }
>
>
> Client:
>
> using System.IO;
> using System.ServiceModel;
>
> namespace nettcptestClient
> {
>    class Program
>    {
>        [ServiceContract]
>        interface ITest
>        {
>            [OperationContract]
>            Stream test();
>        }
>
>        static void Main(string[] args)
>        {
>            var binding=new NetTcpBinding();
>            binding.MaxReceivedMessageSize = 1000000;
>            ChannelFactory<ITest> factory =
>                new ChannelFactory<ITest>(binding, new
> EndpointAddress("net.tcp://localhost:3000"));
>
>            ITest client = factory.CreateChannel();
>            ((IClientChannel)client).Closed += delegate { factory.Close();
> };
>
>            client.test();
>
>        }
>    }
> }
>
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Large-messages-over-NetTcpBinding-tp4016272p4031156.html
> Sent from the Mono - General mailing list archive at Nabble.com.
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20111112/df5ac02b/attachment.html 


More information about the Mono-list mailing list