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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:05:53+00:00 2026-06-15T14:05:53+00:00

There Context: I write a demo console app -a WCF service which running on

  • 0

There

Context:
I write a demo console app -a WCF service which running on Linux by mono, and a console Client which running on Windows 7.

Linux Versoin: Both on Ubuntu and Match-box

Mono Version: 2.10.8.1(On Ubuntu) and 2.10.6(On Match-box)

Issue:
The client could communicate with Service by basicHttpBinding but NOT netTcpBinding.

Exception Info:
Could not connect to net.tcp://192.168.1.220/. The connection attempt lasted for a time span of 00:00:14.0408031. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.1.220:808.

Service Code:

class Program
 {
    static void Main(string[] args)
    { 
        try
        {
            ServiceHost sh = new ServiceHost(typeof(DynIPService.DynIPService));
            //sh.AddServiceEndpoint("DynIPServiceContract.IDynIPService", binding, "net.tcp://10.161.66.213:808");
            sh.Open();
            foreach (var ep in sh.Description.Endpoints)
            {
                Console.WriteLine("Address: {0}, ListenUri: {1}, ListenUriMode: {2} ", ep.Address, ep.ListenUri, ep.ListenUriMode);
            }
            Console.WriteLine("Service is running");               
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error:" + ex.Message);
            throw;
        }
        finally
        {
           Console.ReadKey();
        }
    }
}

Service app.config(partial, here i just list the endpoints and bindings)

<services>
  <service name="DynIPService.DynIPService" behaviorConfiguration="MyServiceTypeBehaviors" >
    <endpoint address="net.tcp://127.0.0.1:808"  
              binding="netTcpBinding" bindingConfiguration="TCP_Binding"
              contract="DynIPServiceContract.IDynIPService"/>
    <endpoint address="http://127.0.0.1:123"
              binding="basicHttpBinding" bindingConfiguration="HTTP_Binding"
              contract="DynIPServiceContract.IDynIPService"/>
  </service>
</services>
<bindings>
  <basicHttpBinding>
    <binding name="HTTP_Binding">
      <security mode="None"></security>
    </binding>
  </basicHttpBinding>
  <netTcpBinding>
    <binding  name="TCP_Binding">
      <security mode="None"></security>
    </binding>
  </netTcpBinding>
</bindings> 

Client Code:

class Program
 {
    static void Main(string[] args)
    {
        //var ip = "localhost.localdomain";
        var ip = "192.168.1.220";

        //Tcp
        Binding tcpBinding = new NetTcpBinding(SecurityMode.None);
        var tcpUri = new Uri(string.Format("net.tcp://{0}:808", ip));

        //http
        Binding httpBinding = new BasicHttpBinding();  
        var httpUri = new Uri(string.Format("http://{0}:123",ip));

        EndpointAddress address = new EndpointAddress(httpUri.ToString());
        IDynIPService proxy = ChannelFactory<IDynIPService>.CreateChannel(httpBinding, address);
        var hostIP = proxy.ReadHostIp();
        Console.WriteLine(hostIP);
        Console.ReadKey();
    }
}
  • 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-15T14:05:54+00:00Added an answer on June 15, 2026 at 2:05 pm

    You need to use the IP address of your host machine that’s publicly visible on the network if you want to connect to it remotely using net.tcp.

    I just tested this on Windows and net.tcp and http actually behave differently when using 127.0.0.1: while HTTP always seem to listen on all interfaces regardless of which IP address you use on your endpoint, using a specific IP such as 127.0.0.1 makes NetTCP only listen on that particular address.

    However, you can use net.tcp://localhost:<port>/<path> to make it listen on all interfaces (this was was implemented in Mono 2.10.10, see bug #275).

    So either use net-tcp://localhost:808/ in your app.config to listen on all interfaces or explicitly set it to a specific IP address (that’s publicly visible on the network) using net-tcp://192.168.1.200:808/ (or whatever the machine’s IP address is).

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

Sidebar

Related Questions

(See question below for more context): Are there any situations in which <machineKey validationKey=AutoGenerate,IsolateApps
I would like to write a context processor which will look the existing context,
Context: There's an application where you draw things on canvas. Where user clicks there's
Question context: let say that there is some really important row in config/locales/en.yml that
There doesn't seem to be a default context menu (with copy, paste, etc.) for
Is there any way to validate spring context xml files in eclipse? Features like:
Is there a way to see how many context switches each thread generates? (both
Is there any analog of django context processors in turbogears2? In tg1 was stdvars,
There is an option to create Internal parameters in SSRS : In what context
Is there a way to use data from the current context to filter nodes

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.