NetNamedPipeBinding in WCF

The NetNamedPipeBinding provides a secure and reliable binding environment for cross-process (same machine) communication. It uses the NamedPipe protocol and provides full support for SOAP security, transactions, and reliability.

NetNamedPipeBinding Properties

The following table is a list of attributes, and their descriptions, that are available to be used with the NetNamedPipeBinding.

Attribute Description
closeTimeout A time interval value, which must be greater than zero, that specifies the amount of time for a close operation to complete. The default value is 1 minute (00:01:00).
hostnameComparisonMode Specifies the HTTP hostname comparison node used to parse URIs. Acceptable values are Exact, StrongWildCard, and WeakWildCard. The default value is StrongWildCard.
maxBufferPoolSize Specifies the maximum buffer size for a buffer pool, which stores messages processed by the binding. This is an integer value with a default of 512*1024, or 524388.
maxBufferSize Specifies the maximum buffer size for a buffer that stores messages processed by the binding. This is an integer value with a default of 65536.
maxConnections A positive integer that specifies the maximum number of inbound and outbound connections that the service will create/accept. The default value is 10. Connections that exceed the specified value
are queued until a space below the specified value becomes available.
maxReceivedMessageSize Specifies the maximum size of a message, including headers. The number is specified in bytes with a default value of 65536. If a message is larger than the value specified, the sender receives a SOAP fault message and the receiver drops the message and creates an event in the trace log.
Name A unique string value that contains the configuration name of the binding.
openTimeout A time interval value that specifies the amount of time a message has to complete. Value should be greater than zero. Default is 1 minute (00:01:00).
receiveTimeout A time interval value that specifies the amount of time a receive operation has to complete. Value should be greater than zero. Default is 1 minute (00:01:00).
sendTimeout A time interval value that specifies the amount of time a send operation has to complete. Value should be greater than zero. Default is 1 minute (00:01:00).
transactionFlow Boolean value, default of False, which specifies whether the binding supports flowing WS-Transactions.
transactionProtocol Specifies the transaction protocol to be used with this binding. Available values are OleTransaction and WS-AtomicTransaction. The default is OleTransaction.
transferMode A valid TransferMode value that specifies whether messages are buffered or streamed during a response or request.

The following example illustrates some of the properties being configured in a configuration file:

<system.serviceModel>
<bindings>
<netNamedPipeBinding>
<binding name = “netnamedpipebind” maxconnections = “50” openTimeout = “00:00:30”>
</binding>
</netNamedPipeBinding>
</bindings>
</system.ServiceModel>

The same can be done through code, as illustrated here:

NetNamedPipeBinding nnpb = new NetNamedPipeBinding();
nnpb.MaxConnections = 90;
nnpb.OpenTimeout = 30000;
Tagged . Bookmark the permalink.

2 Responses to NetNamedPipeBinding in WCF

Leave a Reply