Roy Daniel

Roy Daniel

  • NA
  • 6
  • 0

.Net Remoting Exception(An existing connection was forcibly closed by the remote host)

Jun 28 2006 1:16 AM

I am a .net programmer now working with .NET Remoting .The problem is that when i access the remote object and i am unable to get the lease time of remote object ,also i cant intialise the event in the client side .i am using the channel tcp .it works fine in the intranet and localhost .The error is listed bellow

 

System.Net.Sockets.SocketException was unhandled
  Message="An existing connection was forcibly closed by the remote host"
  Source="mscorlib"
  ErrorCode=10054
  NativeErrorCode=10054
  StackTrace:
    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 offset, Int32 size)
       at System.Runtime.Remoting.Channels.SocketHandler.ReadFromSocket(Byte[] buffer, Int32 offset, Int32 count)
       at System.Runtime.Remoting.Channels.SocketHandler.BufferMoreData()
       at System.Runtime.Remoting.Channels.SocketHandler.Read(Byte[] buffer, Int32 offset, Int32 count)
       at System.Runtime.Remoting.Channels.SocketHandler.ReadAndMatchFourBytes(Byte[] buffer)
       at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadVersionAndOperation(UInt16& operation)
       at System.Runtime.Remoting.Channels.Tcp.TcpClientSocketHandler.ReadHeaders()
       at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
       at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at System.MarshalByRefObject.GetLifetimeService()
       at client.Class1.Main(String[] args) in E:\C# Examples\Remoting\FinalRemoting\Client\Client\Class1.cs:line 73
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()


anyone can help me to solve that problem ? is it related to firewall settings on the server ?

 

thanks in advance