WCF中的由于目标计算机积极拒绝,无法连接
2015-07-17 10:43
155 查看
1.第一种情况
百度上找到了这篇文章 http://blog.sina.com.cn/s/blog_6b44b2ba01016j0z.html
讲的是使用了using用完之后就释放了,得到启发,仔细检查了Host的代码
对比了Learning WCF第一章中的示例代码,发现用try finally来执行的
在finally中将服务关闭了
2.第二种情况
因为之前电脑崩溃过一次,导致本机的net.tcp服务没有激活
http://stackoverflow.com/questions/22562596/unable-to-access-wcf-service-using-net-tcp-binding
Finally with the help of this link: http://rohitguptablog.wordpress.com/2011/06/16/configuring-wcf-service-with-nettcpbinding/, I figured out what was going wrong. Actually I missed the third step in above link. The Net.Tcp services were not running.
====2015年09月14日更新====
发现这个问题有又出现了,本来设置的是自动启动Net.Tcp Listener Adapter
电脑重新开机后,这个服务没有自动启动
查看这个服务的属性-->依存关系
发现Net.Tcp Port Sharing Service没有自动启动
解决方法:
将Net.Tcp Port Sharing Service这个服务改为自动启动。
百度上找到了这篇文章 http://blog.sina.com.cn/s/blog_6b44b2ba01016j0z.html
讲的是使用了using用完之后就释放了,得到启发,仔细检查了Host的代码
对比了Learning WCF第一章中的示例代码,发现用try finally来执行的
在finally中将服务关闭了
try { //打开服务的代码 //有2个Service打开 } finally { CloseHost(hostA); CloseHost(hostB); }
2.第二种情况
因为之前电脑崩溃过一次,导致本机的net.tcp服务没有激活
http://stackoverflow.com/questions/22562596/unable-to-access-wcf-service-using-net-tcp-binding
Finally with the help of this link: http://rohitguptablog.wordpress.com/2011/06/16/configuring-wcf-service-with-nettcpbinding/, I figured out what was going wrong. Actually I missed the third step in above link. The Net.Tcp services were not running.
====2015年09月14日更新====
发现这个问题有又出现了,本来设置的是自动启动Net.Tcp Listener Adapter
电脑重新开机后,这个服务没有自动启动
查看这个服务的属性-->依存关系
发现Net.Tcp Port Sharing Service没有自动启动
解决方法:
将Net.Tcp Port Sharing Service这个服务改为自动启动。
相关文章推荐
- PAT 数据结构 06-图8. 关键活动(30)
- Java学习笔记------网络编程
- nfs网络文件系统
- http防盗链
- Java HttpURLConnection超时问题
- HttpSessionListener, HttpSessionAttributeListener的用法及简单实例
- linux安装apache httpd
- TCP通信的三次握手和四次撒手的详细流程(顿悟)
- Java LinkedList特有方法程序小解 && 使用LinkedList 模拟一个堆栈或者队列数据结构。
- 计算机图形学-预告3
- 计算机图形学-预告2
- 计算机图形学-预告1
- HTTP协议之multipart/form-data请求分析
- 计算机中浮点数的表示
- 【Android】仿UC网络判断效果
- 数据结构进制转换源代码
- 数据结构赫夫曼树源程序
- 数据结构二叉树源程序
- 数据结构迷宫源程序
- xref: /frameworks/av/media/libstagefright/httplive/M3UParser.cpp