TCP error code 10061: Unable to connect because the target computer is actively rejected. Singular problem

Source: Internet
Author: User

Some time ago, I looked at WCF and basically learned about the process of WCF. Basically, an interface is used for communication. I am not very clear about the specific internal knowledge.

Today, I want to know nothing about it, just as I would like to study it myself. I also want to see if I can write the interfaces in WCF separately, that is, I can uninstall different projects. I did this today. The first problem I found was that I could not access it. That is, the client endpoint node issues.

1. Address Settings. The settings here should be the same as the address settings on the host side, so that you can access the host through the interface.

2. Contract settings problems. I used to set the interface corresponding to the host interface. However, this setting always fails and was discovered later, it turns out that the interface configured here is the client interface, that is, the interface inherited from the client.

In this way, the problem is basically solved.

Then we found a magic problem, "TCP error code 10061: Unable to connect because the target computer is actively rejecting it. "

I started the host in the debug folder (Project/bin/debug. Then the service address is opened in the browser. Correct. Why can't it be accessed,

After being depressed for more than an hour, I still couldn't find a solution. So I went to Google and found many similar problems. In the http://topic.csdn.net/u/20090508/17/5ba7618d-035d-498e-8b35-0573ea269706.html this post found, there may be a lot of problems, buddy can only be tested one by one, the result is sad reminder is, the problem is still.

Later, I started the host in the debug folder and then started the client. What's amazing is that the problem was solved. I thought it was my solution. The same problem still exists when I use the source code for debugging. This time I should have found the root cause of the problem. The problem may be that the client is started before the host because of the multi-project startup I set in solution in vs2008. I adjusted their order and found that the problem still persists. Then I added some code to the client to add the main thread. sleep (5000); then the problem is solved during the test.

Ah! It's really troublesome.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.