views:

49

answers:

1

I am trying to get working a WCF named pipe communication between two processes on the same computer (on XP), but I am having trouble with "large" messages disappearing. The messages that disappear contain a largish byte array and I have narrowed the failure down to when the array is around 16k in size. Smaller than that and the message gets through. Larger than that and the sender says it went fine but it is never received. I have tried bumping up the buffer sizes on both sender and receiver as per this code for the server:

PipeServer pipeServer = new PipeServer();

ServiceHost serviceHost = new ServiceHost(pipeServer, new Uri[] { new Uri(baseName) });

NetNamedPipeBinding netNamedPipeBinding = new NetNamedPipeBinding();
netNamedPipeBinding.MaxBufferPoolSize = 5000000;
netNamedPipeBinding.MaxBufferSize = 500000;
netNamedPipeBinding.MaxReceivedMessageSize = 500000;

serviceHost.AddServiceEndpoint(typeof(ISSNPipeServer), netNamedPipeBinding, pipeName);

and this code for the client:

_callbacks = new PipeClientCallbacks();

NetNamedPipeBinding netNamedPipeBinding = new NetNamedPipeBinding();
netNamedPipeBinding.MaxBufferPoolSize = 5000000;
netNamedPipeBinding.MaxBufferSize = 500000;
netNamedPipeBinding.MaxReceivedMessageSize = 500000;

_pipeFactory = new DuplexChannelFactory<ISSNPipeServer>(_callbacks,
                  netNamedPipeBinding,
                  new EndpointAddress(_targetPipe));

_pipeProxy = _pipeFactory.CreateChannel();

I am eventually looking to transfer arrays in the 60KB size, but this is my first serious WCF experience and I have no idea even where to really start looking.

So any suggestions?? Thanks!

A: 

You can enable WCF tracing on the server to get more information as to what the failure is. Likely, you still need to increase the reader quotas associated with the binding (NetNamedPipeBinding.ReaderQuotas). Check the MaxArrayLength one in particular.

tomasr
That max array length parameter is very suspicious at a default value of 16384. But please humor me and suggest where I look to change that. For some reason I was also thinking that named pipes on the same box did go via xml
Peter M
Yep .. that fixed it. Thanks
Peter M