Client-Server Communication
Im using .Net 1.1 SP1, and in my scenario, I have the server and the client applications that use tcp channel and binary formatter.
The client connects to the server, and registers himself by calling the server subscribeClient method, this method receives an object named (client) that is an instance of IClient and is MarshalByRefObject and marked with the [Serialiazable] attribute, this object contains the client properties and the methods that the server needs call at the client side later, this scenario is working fine when the client and the server are on the same machine or reside within the same LAN, when the client tries to connect to the server through the internet he is being able to instantiate the Remote server object by calling the subscribeClient method, but when this method tries to retreive any client property like "client.name" I get the following Exception message at the server:-
"Server encountered an internal error. For more information, turn on customErrors in the server’s .config file”
I've reset the parameters in the Server.config and client.config files as it follows to include the <customErrors mode="off"/>, and then after re-executing the scenario I've got the following Exception message at the server side:-
"No connection could be made because the target machine actively refused it"
-
Server.config
--
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name = "EventsManagerHost">
<service>
<wellknown type="EventsManager.Hoster,EventsManager" objectUri="Connect" mode="Singleton" />
</service>
<channels>
<channel ref="tcp" port="1940">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
</application>
<customErrors mode="off"/>
</system.runtime.remoting>
</configuration>
-
Client.config
-
<configuration>
<system.runtime.remoting>
<application name="Server">
<client>
<wellknown
type="EventsManager.Hoster, EventsManager"
url="tcp://212.118.18.71:1940/Connect"
/>
</client>
<channels>
<channel ref="tcp" port="0" clientConnectionLimit="20">
<clientProviders>
<formatter ref="binary" />
</clientProviders>
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
</application>
<customErrors mode="off"/>
</system.runtime.remoting>
</configuration>
Any help would be highly appreciated.
Many thanks,
Sara

