0

I can establish remote communication betweeen client and server but every time the client calls a method on the Client Activated remotable object I get a System.Net.WebException:

{"The underlying connection was closed: An unexpected error occurred on a receive."}

There is a System.IO.IOException INnerException
{"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."}

The stack trace is this:

"\r\nServer stack trace: \r\n   
at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessResponseException(WebException webException, HttpWebResponse& response)\r\n   
at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)\r\n   
at System.Runtime.Remoting.Channels.SoapClientFormatterSink.SyncProcessMessage(IMessage msg)\r\n\r\n
Exception rethrown at [0]: \r\n   
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n   
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n   
at Remoting.Example.DoSomething() ....
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n   
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n   
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   
at System.Threading.ThreadHelper.ThreadStart()"
Karthik
  • 2,391
  • 6
  • 34
  • 65
John Smith
  • 4,416
  • 7
  • 41
  • 56
  • Just wanted to make sure you knew that Remoting has been replaced by WCF. – John Saunders Oct 28 '12 at 18:42
  • Thanks for making sure that I know. yes I know. And I still don't have an answer to my question. – John Smith Oct 28 '12 at 18:44
  • You are 100% sure the server is running? – rene Oct 28 '12 at 18:45
  • yes, 100%. I know it because the constructor is definitely getting called (ie: it's printing a message on the server when the client connects). I only have this problem with Client Activated types. ie: the ones where you do RegisterActivatedServiceType() on the server and RegisterActivatedClientType() on the client.) – John Smith Oct 28 '12 at 18:47

1 Answers1

0

For all it's worth, the problem was solved when I changed the channel on the server and client from http to tcp.

John Smith
  • 4,416
  • 7
  • 41
  • 56