If the remoting server has multiple NICs and multiple IP addresses, the client callback may fail, after debugging, the client will call back to another IP address on the server (for example, the Internet address, rather than the Intranet address ). Generally, the configuration of the remoting server is as follows:
< Channel Ref = "TCP" Port = "55555" >
Or useCodeMethod:
Idictionary props = New Hashtable ();
Props [ " Port " ] = 55555 ;
Ichannel Channel= NewTcpchannel (props, clientprovider, serverprovider );
There are several solutions to this problem:
1. Bind the channel to the machine name (using "machinename") instead of the IP address. However, this requires that customers of different network segments can find this server through the same DNS name. This attribute overwritesUseipaddressAttribute settings.
< Channel Ref = "TCP" Port = "55555" Machinename = "Firewall.yourdomain.com" />
Code method:
Idictionary props = New Hashtable ();
Props [ " Port " ] = 55555 ;
Props [ " Machinename " ] = " Firewall.yourdomain.com " ;
Ichannel Channel= NewTcpchannel (props, clientprovider, serverprovider );
For details about the "machinename" attribute, refer to msdn:
Http://msdn.microsoft.com/en-us/library/c5zztdc3%28VS.80%29.aspx
2. Open a channel for each IP address on the server and use "bindto ".
For details about the bindto attribute, see msdn: specify an IP address of the NIC to bind to when more than one Nic is installed in a machine. this attribute can only be used in the server side.
Configuration example:
< Channel Ref = "TCP" Port = "55555" Bindto = "197.118.137.8" >
< Serverproviders >
< Formatter Ref = "Soap" Typefilterlevel = "Full" />
< Formatter Ref = "Binary" Typefilterlevel = "Full" />
</ Serverproviders >
</ Channel >
3. Obtain the Client IP address through the server sink, manually configure a table similar to the route table, and select a correct Server IP address through the Client IP address.
We can use trackinghandler to use a correct IP address when Marshal marshalbyrefobject on the server side.
For the implementation method, refer to the article reproduced by Zhang YiArticle: Http://www.cnblogs.com/wayfarer/articles/69104.html