Pergunta

Eu tenho um processo em uma rede que deseja conversar com um serviço em outra rede. Então, eu tenho dois computadores:

Client                            Server
172.X.X.X  reroute-> 172.X.X.X to 10.0.1.X

Com essa configuração, posso ligar para o servidor com o endereço IP 172.xxx e ele mapeia o endereço 10.0.1.x e fala bem. No entanto, quando tento usar o .NET Remoting and Comunico, recebo uma exceção:

System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.0.1.240:8196

Server stack trace: 
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(EndPoint ipEndPoint)
   at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
   at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()
   at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
   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 Aloha.Automation.IBackOfHouseFileServer.get_SecurityKey()
   at Aloha.Automation.Presentation.ViewModel.TerminalViewModel.RefreshSecurityKeyFromTerminal() in c:\BuildAgent\work\78a60abb233492e7\Source\Aloha.Automation.Presentation\ViewModel\TerminalViewModel.cs:line 167
   at Aloha.Automation.Presentation.ViewModel.TerminalViewModel.Refresh() in c:\BuildAgent\work\78a60abb233492e7\Source\Aloha.Automation.Presentation\ViewModel\TerminalViewModel.cs:line 225
   at Aloha.Automation.Presentation.ViewModel.TerminalViewModel.LabConnectorViewModelOnPropertyChanged(Object sender, PropertyChangedEventArgs args) in c:\BuildAgent\work\78a60abb233492e7\Source\Aloha.Automation.Presentation\ViewModel\TerminalViewModel.cs:line 154
   at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   at Caliburn.Core.PropertyChangedBase.RaisePropertyChangedEventImmediately(String propertyName) in c:\Code\caliburn\branches\v1.1\src\Caliburn.Core\PropertyChangedBase.cs:line 49
   at Aloha.Automation.Presentation.ViewModel.ExtendedPresenter.<>c__DisplayClass1.<NotifyOfPropertyChange>b__0() in c:\BuildAgent\work\78a60abb233492e7\Source\Aloha.Automation.Presentation\ViewModel\DetailsViewModel.cs:line 42
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)]]>

Como devo lidar com essa situação? Preciso trocar tecnologias remotas ou rolar as minhas?

Foi útil?

Solução

Isso não é possível com .NET. Quando você estiver com problemas de redação de IP, mude para o WCF.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top