我正在通过 .NET Remoting 实现发布者/订阅者模式。我的发布者正在等待其 url 上的传入请求。在其一侧,远程环境配置正确,完全没有问题。
在订阅者端,当我从它的一侧向发布者进行一些订阅时,它会挂掉。我的意思是程序挂起,控制台什么也没显示,然后它就消失了,这里也不例外。当我断开发布者的连接时,它现在恢复并跟踪处理并使用堆栈跟踪抛出异常:
这是堆栈跟踪..
**System.Net.Sockets.SocketException (0x80004
005): An existing connection was forcibly closed by the remote host
Server stack trace:
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size,
SocketFlags socketFlags)
at System.Runtime.Remoting.Channels.SocketStream.Read(Byte[] buffer, Int32 of
fset, Int32 size)
at System.Runtime.Remoting.Channels.SocketHandler.ReadFromSocket(Byte[] buffe
r, Int32 offset, Int32 count)
at System.Runtime.Remoting.Channels.SocketHandler.Read(Byte[] buffer, Int32 o
ffset, Int32 count)
at System.Runtime.Remoting.Channels.SocketHandler.ReadAndMatchFourBytes(Byte[
] buffer)
at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadAndMatchPreamble
()
at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadVersionAndOperat
ion(UInt16& operation)
at System.Runtime.Remoting.Channels.Tcp.TcpClientSocketHandler.ReadHeaders()
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage
(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITranspor
tHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMess
age(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
at DTFSharedObjects.IRemoteEventsPublisher.AddSubscription(Type type, String
url)
at AgentTestRunner.CTestRunner.createSubscription() in d:\dtfsourcecode\dtf_b
ackend\agentsourcecode\sourcecode\runnercode\testrunner\testrunner.cpp:line 438**
问候乌斯曼