Could not connect to net.tcp: The connection attempt lasted for a time span

Is 127.0.0.1:808 the actual IP:Port reported in the error? If so then you need to fix the IP (127.0.0.1 is synonymous with localhost, so that would be your local computer).

Otherwise, this looks like a firewall issue.

There are two common sources of a firewall:

  • Router
  • OS

Router firewalls are usually found on the router which connects the internal network to the internet. In these cases you (or someone with access) will need to log into the router and forward the port to the IP for the machine. This is only required if the two computers which are trying to communicate are not on the same internal network.
For example if your computer is connecting through the internet to the server then setting up port forwarding is required. If both computers are on the same network in the same office then port forwarding is not required (cases where this is not true are common in larger companies, but then there is an IT or network person to deal with the port issues).

Assuming your server is running Windows, you will need someone with Admin(?) access to log in and either open the port or allow your service to accept incoming requests. Since you indicated that you do not have access to the server I would suggest having the people in charge of the server verify the configuration.


Starting the Net.Tcp Listener Adapter service has fixed the problem.

Starting the Net.Tcp Listener Adapter service has fixed the problem.


The most common problem for me is the Windows Service Net.Tcp Listener Adapter is not running on the hosting machine.

Also check your IIS Web Application to ensure Enabled Protocols includes net.tcp. For instance mine has "http,net.tcp" and in my bindings I have "http::94:,net.tcp:194:"

I don't know of any good way to remotely check that IIS is configured correctly or the Windows Service is running. Do you not have a server admin that can look at these values for you?

Tags:

C#

Wcf