<iframe align="center" marginwidth="0" marginheight="0" src="http://www.zealware.com/csdnblog336280.html" frameborder="0" width="336" scrolling="no" height="280"></iframe>
这一问题一般出现在Console application/Windows Service承载Remote Objects时,要求Remote Server指定特定port。IIS在承载Remote Objects并不需要指定特定port,因此一般不会出现SocketException异常信息。
1. 启动承载Remote Objects的Console application,发现指定的port状态为:LISTENING。
显然Remote Server开始监听该port,可以接受Client端的请求。
2. 在关闭承载Remote Objects的Console application后,发现指定的port状态为:TIME_WAIT。
如果现在启动该Console application,就会抛出如下异常:
An unhandled exception of type 'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll
Additional information: Remoting configuration failed with the exception System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port)
is normally permitted
SocketException异常:每一个socket address (protocol/network address/port)只能有一个使用。
3. 个人观点
关于TIME_WAIT状态,这是windows系统设计的,防止来自旧的连接(old connection)的剩余packets干扰新的连接(new connection)。因此,默认会等待4分钟,让那些剩余的packets丢弃掉。
因此,不要试图去解决这一问题。等待4分钟左右的时间,确认该port确定已释放,再启动Remote Server,如Console application/Windows Service等。
不同观点或意见,请发表评论或指出。谢谢。
分享到:
相关推荐
Microsoft .NET RemotingMicrosoft .NET Remoting Microsoft .NET RemotingMicrosoft .NET Remoting Microsoft .NET RemotingMicrosoft .NET Remoting
使用.NET Remoting从服务器主动发出事件通知客户端(远程广播) 经常看见有人问:使用.NET Remoting...在.NET Remoting中你可以方便的采用事件注册远程回调函数,并方便的利用这种机制将服务器端信息广播到客户端。
VB.NET Remoting 技术手册VB.NET Remoting 技术手册
Advanced .NET Remoting.pdf
一个.NET Remoting的简单实例,源码,打开即用,适合新手和做测试的相关技术人员。
Microsoft .Net Remoting系列专题
.Net Remoting技术.pdf
一个很简单的.net remoting 实例,如果你懂得这种技术建议你就不用下了,这个只是知道.net remoting ,但是不知道什么原理的同学下载学些,知道是如何进行操作的。代码包含服务端、客户端和接口实例。简单的描述了...
演示如何使用.net Remoting示例,从而更好的学习和使用.net Remoting
C# .Net Remoting 两个简单示例,一个为普通的,一个为工厂模式的,更为安全一点.简单范例却是打好了一个框架,想要做东西,扩展就可以了. 使用说明和运行截图:http://www.our-code.com/news/2010105/n4920152.html 关于2...
介绍.net下的Remoting技术. Microsoft .Net Remoting系列专题之一
一个C#.NET Remoting示例 ChannelServices.RegisterChannel(new TcpChannel(9090), true); RemotingConfiguration.ApplicationName = "HelloServiceApplication"; RemotingConfiguration....
.Net Remoting非常简单范例代码
基于.NET Remoting的分布式系统实现.pdf
Advanced .NET Remoting_2nd.pdf
深度挖掘.NET Framework 2.0(8):实战.NET Remoting(下)
基于.NET Remoting实现了一个工作在局域网的聊天室程序,包含一个.NET SVR,客户端(窗口程序)。 程序充分演绎了.net remoting事件双向订阅的应用方法。
本例程是自己用.NET Remoting Broadcast通信机制编写C/S原型,分为VS2005和VS2008两个版本。
看名字就该知道什么内容了吧,属于VB.NET高级点的资料,有需求的下好了!
Advanced .NET Remoting 第二版, 内容为纯英文,有兴趣的朋友可以下来看看。