Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9068547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:13:04+00:00 2026-06-16T17:13:04+00:00

We are using WCF for transferring data from a server application to several clients.

  • 0

We are using WCF for transferring data from a server application to several clients. Actually, for most of the traffic, client and server are running on the same machine, so I would expect the transfer to be really fast.

However, when transferring large arrays (16-bit grayscale images), it takes several seconds until the data is transferred. For a 16 MB image, it takes around 3-5 seconds!

Initially, we were using ushort arrays because it is the most suitable data type for storing 16-bit grayscale image data. However, this was extremely slow: something around 20-25 seconds for 16 MB. When we copy the data to a byte array before serialization using Buffer.BlockCopy, it is reduced to 3-5 seconds for some reason. However, 3-5 seconds for transferring 16 MB from one application to another running on the same machine still seems far too long to me!

Therefore, my question is: How can we improve the performance for such a scenario?

I already investigated protobuf-net from Marc Gravell, but I am uncertain whether it would help in this case… Any experiences or other suggestions?

Here is the source code of one of our data classes (containing the image data):

[DataContract(IsReference = true)]
public class ImageData
{
    private ushort[] m_pixelData;

    public ushort[] PixelData
    {
        get
        {
            return m_pixelData;
        }
        set
        {
            m_pixelData = value;
            OnPropertyChanged("PixelData");
        }
    }

    [DataMember]
    public override byte[] FileData
    {
        get
        {
            if (this.PixelData == null)
            {
                return null;
            }

            return ListHelper.ConvertToByteArray(this.PixelData);
        }
        set
        {
            if (value == null)
            {
                this.PixelData = null;
                return;
            }

            this.PixelData = ListHelper.ConvertToUshortArray(value);
        }
    }

}

Note that only the FileData property is marked as [DataMember], so that the PixelData property is not serialized!

Here are the relevant parts of the server’s app.config:

<system.serviceModel>
    <services>
        <service name="Services.ImageDataService" behaviorConfiguration="ServicesBehavior">
            <host>
                <baseAddresses>
                    <add baseAddress="net.tcp://localhost:8008/ImageDataService" />
                </baseAddresses>
            </host>
            <endpoint address="" binding="netTcpBinding" bindingConfiguration="NetTcpBindingLargeFileTransfer" contract="Services.IImageDataService" />
            <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange" />
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="ServicesBehavior">
                <serviceMetadata httpGetEnabled="false" />
                <serviceDebug includeExceptionDetailInFaults="false" />
                <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <bindings>
        <netTcpBinding>
            <binding
                name="NetTcpBindingLargeFileTransfer"
                openTimeout="00:01:00" closeTimeout="00:01:00" receiveTimeout="infinite" sendTimeout="infinite"
                transactionFlow="false" transactionProtocol="OleTransactions"
                transferMode="Buffered" hostNameComparisonMode="StrongWildcard" listenBacklog="10"
                maxBufferPoolSize="2097152" maxBufferSize="1073741824" maxConnections="10" maxReceivedMessageSize="1073741824">
                <readerQuotas
                    maxDepth="2147483647" maxStringContentLength="2147483647"
                    maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
                <reliableSession ordered="true" inactivityTimeout="infinite" enabled="false" />
                <security mode="None">
                    <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
                    <message clientCredentialType="Windows" />
                </security>
            </binding>
        </netTcpBinding>
    </bindings>
</system.serviceModel>

And the client’s app.config:

<system.serviceModel>
    <bindings>
        <netTcpBinding>
            <binding
                name="NetTcpBindingLargeFileTransfer"
                openTimeout="00:01:00" closeTimeout="00:01:00" receiveTimeout="infinite" sendTimeout="00:10:00"
                transactionFlow="false" transactionProtocol="OleTransactions"
                transferMode="Buffered" hostNameComparisonMode="StrongWildcard" listenBacklog="10"
                maxBufferPoolSize="2097152" maxBufferSize="1073741824" maxConnections="10" maxReceivedMessageSize="1073741824">
                <readerQuotas
                    maxDepth="2147483647" maxStringContentLength="2147483647"
                    maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
                <reliableSession ordered="true" inactivityTimeout="infinite" enabled="false" />
                <security mode="None">
                    <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
                    <message clientCredentialType="Windows" />
                </security>
            </binding>
        </netTcpBinding>
    </bindings>
    <client>
        <endpoint
            address="net.tcp://localhost:8008/ImageDataService"
            binding="netTcpBinding"
            bindingConfiguration="NetTcpBindingLargeFileTransfer"
            contract="Services.IImageDataService"
            name="Services.IImageDataService"
            behaviorConfiguration="ServicesBehavior" />
    </client>
    <behaviors>
        <endpointBehaviors>
            <behavior name="ServicesBehavior">
                <dataContractSerializer maxItemsInObjectGraph="2147483647"></dataContractSerializer>
            </behavior>
        </endpointBehaviors>
    </behaviors>
</system.serviceModel>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T17:13:05+00:00Added an answer on June 16, 2026 at 5:13 pm

    On the same machine try named pipes.

    Choosing a Transport

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using WCF services in the client application for transfering data from client to
Using WCF i get data from server. Data contains Folders and these folders contain
I've an application using WCF on client and server side. I get errors when
I am using WCF service in my client-server application and I am facing following
I'm using WCF to pass data from one application to another. During execution I
I am using WCF in my project to transfer data from a server (which
I'm having issues transferring lazy loaded data over the wire using WCF and NHibernate.
I'm using WCF in communication between a server and client (both written in C#).
I'm using WCF (.NET 3.5) to communicate with a server using SOAP. When running
I'm using WCF to create a connection beween a server app and client app.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.