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

  • SEARCH
  • Home
  • 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 7588319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:53:37+00:00 2026-05-30T19:53:37+00:00

Our application server exposes 5 WCF services over the net.tcp transport, all on the

  • 0

Our application server exposes 5 WCF services over the net.tcp transport, all on the same port. We’ve been hosting these during development using WcfSvcHost and I’ve never had to think about how these manage to use the same port.

We’re moving them to a Windows Service now, and now I’m instantiating the ServiceHost instances myself. One of the services uses Streamed TransferMode over Tcp.

When starting these services using a configuration file with WcfSvcHost, they work fine. But in our service it complains about the port being in use.

Should it be possible for the streamed service to use the same port?

  • 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-05-30T19:53:38+00:00Added an answer on May 30, 2026 at 7:53 pm

    I solved the problem eventually, after alot of trial and error with programmatic configuration of the bindings.

    It seems that something in the binding stack generated when you create a NetTcpBinding allows multiple NetTcpBindings to share a port. The problem was that I needed to make a custom binding.

    The Solution ended up being to create a custom binding based on a NetTcpBinding. For example:

            var lBinding = new NetTcpBinding() 
            {
                SendTimeout = TimeSpan.FromMinutes(5),
                ReceiveTimeout = TimeSpan.FromMinutes(5),
    
                MaxConnections = 100,
                ReliableSession = new OptionalReliableSession 
                { 
                    Enabled = true,
                    Ordered = true,
                    InactivityTimeout = TimeSpan.FromMinutes(30)
                },
                Security = new NetTcpSecurity
                { 
                    Mode = SecurityMode.TransportWithMessageCredential,
                    Message = new MessageSecurityOverTcp { ClientCredentialType = MessageCredentialType.UserName } 
                },
                MaxReceivedMessageSize = 524288
            };
    
            var lCustomBinding = new CustomBinding(lBinding);
    
            // Edit the custom binding elements here
    
            var lEndpoint = new ServiceEndpoint(lContract, lCustomBinding, new EndpointAddress(pServiceHost.BaseAddresses.First()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are currently calling web services on our application server through our web server
Our server application is listening on a port, and after a period of time
Our application uses SQL Server Reporting Services and allows users to add custom filters
Our server application runs as a service and has a ASP.NET MVC3 web-based frontend
We have a server application that exposes a certain model, and set of services
Our application often connects to a different kind of back-ends over web services, MQ,
Our application uses Hibernate with Sql Server 2005. Being a DBA, I am not
Our application uses a SQL Server back-end with many stored procedures. Recently, while trying
Our application fetches the correct database server from a pool of database servers. So
In our client/server application, a user can log in using a username/password. The server

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.