NNP
NNP

Reputation: 3451

Do I need to configure the binding at both client and server?

I am using NetNamedPipeBding to communicate with a service in local machine. I understand I need to define the configuration settings for client like maxstringcontentlength, sendtimeout, maxbyteperread etc.

Do I need to define the same things at server side as well? What is the relationship between these two? If the client doesn't have configuration settings while connecting to it, will it use its default binding settings? Are they totally independent?

For ex: I defined the below settings for client

    <netNamedPipeBinding>
            <binding name="NetNamedPipeBinding_IService" closeTimeout="00:01:00"
               openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
               transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
               hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647"
               maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                  maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <security mode="None">
                <!--<transport protectionLevel="EncryptAndSign" />-->
              </security>
            </binding>
          </netNamedPipeBinding>

And I also defined at server side similar settings:

  <services>
      <service behaviorConfiguration="ServiceBehavior" name="Namespace.Service" />
    </services>

    <bindings>
      <netNamedPipeBinding>
        <binding name="NetNamedPipeBinding_Service" closeTimeout="00:01:00"
           openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
           transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
           hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647"
           maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
              maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <!--<transport protectionLevel="EncryptAndSign" />-->
          </security>
        </binding>
      </netNamedPipeBinding>                 
    </bindings>

Upvotes: 4

Views: 318

Answers (1)

Muhammad Hasan Khan
Muhammad Hasan Khan

Reputation: 35146

Some settings are relevant on both ends and some are relevant only on the server while some on client. Generally most settings should have same value and yes you need to configure the binding at both ends. One will not use the settings of other after connection is established.

Upvotes: 1

Related Questions