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 <[email protected]> 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 - [email protected]
> http://lists.ximian.com/mailman/listinfo/mono-list
>
_______________________________________________
Mono-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list