Hallo,
How can I configure these socket options in .NET Remoting? May be my problem is not much clear that why I would like to explain my problem in more detail.
I am using .NET remoting to develop a server and a client . Server also requests the services of client, that means client also acts as server and server as client.
Picture of whole scenario
~~~~~~~~~~~~~~~~~~
When client requests server for login, he also supplies reference to a remote object for callback(Created in client and passed to server for callback). Server notes the reference of this object. Communication works without any problem. But when I unplug the cable of client and server tries to call method of client's remote object, then it takes too long until server receives SocketException.
Config file of server
~~~~~~~~~~~~~~
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGrou p, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Server.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<system.runtime.remoting>
<application>
<lifetime leaseTime="30D" renewOnCallTime="30D"/>
<channels>
<channel ref="tcp" port="1234">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
<clientProviders>
<formatter ref="binary" />
</clientProviders>
</channel>
</channels>
<service>
<wellknown mode="SingleCall" type="Server.Server, IMServer" objectUri="Server.rem" />
</service>
</application>
</system.runtime.remoting>
</configuration>
~~~~~~~~~~~~~~~~
Client Configurationfile
~~~~~~~~~~~~~~~~
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Client.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<system.runtime.remoting>
<application>
<lifetime leaseTime="30D" renewOnCallTime="30D"/>
<channels>
<channel ref="tcp" port="0">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
<clientProviders>
<formatter ref="binary" />
</clientProviders>
</channel>
</channels>
<client>
<wellknown type="General.IServer, IMGeneral" url="tcp://localhost:1234/Server.rem"/>
</client>
</application>
</system.runtime.remoting>
</configuration>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Creation of remote object of Client for callback
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clientEvents = new ClientEvents();
~~~~~~~~~~~~~~~~~~~~~~~
Pass it to server while loging in.
~~~~~~~~~~~~~~~~~~~~~~~
server.LogOn(..... clientEvents, ...)
Server stores its reference and call functions of it. It works very nice but when I unplug the cable of client computer and server tries ot call the function of this client using the object "clientEvents", then it takes too long until it receives SocketException. How can I reduce the time the server waits when client is not available on the network.
Thanks