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 765067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:49:46+00:00 2026-05-14T16:49:46+00:00

I have a problem with what solution to choose.. I have a server running

  • 0

I have a problem with what solution to choose..
I have a server running having a Service running that can receive orders from a website.
To this server several client (remote computers) are connected somehow.

I would really like to use WCF for all comunication, but not sure it’s possible.

I dont wanna configure all client firewall settings in their routers, so the clients would have to connect to the server.

But when an order is recieved on the server, it should be transferred to a specific client.

One solution could be to have the Client connect using a duplex binding, but it will have to somehow keep the connection alive in order to be able to received data from server… Is this a good way to do this ??

Normally the connection times out and probably for a good reason…

Anyone have insight to this problem.

Thx alot for any advise 🙂

Best Regards
Søren Müller

  • 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-14T16:49:47+00:00Added an answer on May 14, 2026 at 4:49 pm

    This is exactly what duplex bindings were designed for. The two best choices you have are NetTcpBinding or PollingDuplexBinding.

    The former uses a TCP protocol which may not be suitable for your clients if they aren’t on your network. However, it does allow two-way communication over a client-initiated socket. So the client doesn’t need to be able to accept incoming connections. I recently used this on a project and it works very well. It’s also very responsive. When client applications close, the session on the server immediately ends.

    The second option, PollingDuplexBinding is included in the Silverlight SDK. It uses a client-initiated “long” HTTP request. The request waits for messages that need to go out to the client and when they arrive, the client request returns. The client then initiates a new HTTP request back to the server. In other words, the client always has a pending HTTP request. This works well over firewalls and should be used when you’re dealing with internet clients. However, I’ve found this to be not as responsive as NetTcpBinding. I may have been doing something wrong but it seemed like attempts to send callbacks to abandoned client sessions took a while to “time out”.


    Here’s an example of the configuration file from my recent project that used NetTcpBinding for duplex communication. Note that other than some tweaks to service throttling I am pretty much using the defaults for this binding. But there’s all kinds of things you can tweak such as receiveTimeout, inactivityTimeout, etc.

    <configuration>
        <system.serviceModel>
    
            <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    
            <behaviors>
                <serviceBehaviors>
                    <behavior name="">
                        <serviceMetadata httpGetEnabled="true" />
                        <serviceDebug includeExceptionDetailInFaults="true" />
                        <serviceThrottling maxConcurrentCalls="65535" 
                                           maxConcurrentSessions="65535" 
                                           maxConcurrentInstances="65535" />
                    </behavior>
                </serviceBehaviors>
            </behaviors>
    
            <bindings>
                <netTcpBinding>
                    <binding maxConnections="65535">
                        <security mode="None" />
                    </binding>
                </netTcpBinding>
            </bindings>
    
            <services>
                <service name="BroadcastService">
                    <endpoint address="" binding="netTcpBinding" contract="BroadcastService" />
                </service>
            </services>
    
        </system.serviceModel>
    </configuration>
    

    [ServiceContract( CallbackContract = typeof( IBroadcastCallback ) )]
    [ServiceBehavior( ConcurrencyMode = ConcurrencyMode.Multiple )]
    public class BroadcastService : IDisposable
    {
    
        [OperationContract(IsInitiating=true)]
        public long Subscribe( Guid clientID )
        {
            // clients call this to initiate the session
        }
    
        [OperationContract(IsOneWay = true)]
        public void Publish( BroadcastMessage message )
        {
            // client calls this to broadcast a message to
            // all other subscribed clients via callback
        }
    
    }
    
    [ServiceContract( Name = "BroadcastCallback" )]
    public interface IBroadcastCallback
    {
    
        [OperationContract( IsOneWay = true, AsyncPattern = true )]
        IAsyncResult BeginBroadcast(BroadcastMessage Message, AsyncCallback callback, object state);
    
        void EndBroadcast( IAsyncResult asyncResult );
    
    }   // interface
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.