Proble with ClientSponsor
I use IIS to host my CAO. And run WinForms App as a client. Everything is fine except my server instance becomes unreachable after approximately 5 minutes of client being idle. Now I’m trying to use ClientSponsor to solve the problem but it doesn’t work. What is wrong in my code?
Server config file:
Client code:
IDictionary props = new Hashtable();
props["credentials"] = CredentialCache.DefaultCredentials;
props["port"] = 4001;
props["useDefaultCredentials"] = "true";
props["typeFilterLevel"] = "Full";
HttpChannel channel = new HttpChannel(props,
new BinaryClientFormatterSinkProvider(),
new BinaryServerFormatterSinkProvider());
ChannelServices.RegisterChannel(channel);
ActivatedClientTypeEntry atEntry =
new ActivatedClientTypeEntry(typeof(ServerClass),
"http://localhost:80/Server");
RemotingConfiguration.RegisterActivatedClientType(atEntry);
ServerClass instance = new ServerClass();
ClientSponsor sponsor = new ClientSponsor(TimeSpan.FromMinutes(5));
if (!sponsor.Register(instance))
throw(new Exception("Couldn't register sponsor."));
instance.Connect();
pl1Posted Jan 14, 2005, 1:44 PM
shimtannyPosted Jan 14, 2005, 7:50 AM
pl1Posted Jan 14, 2005, 7:20 AM
shimtannyPosted Jan 14, 2005, 6:23 AM
pl1Posted Jan 13, 2005, 3:40 PM
shimtannyPosted Jan 13, 2005, 4:42 AM
pl1Posted Jan 12, 2005, 3:54 PM
pl1Posted Jan 12, 2005, 5:14 AM
shimtannyPosted Jan 11, 2005, 6:35 PM
pl1Posted Jan 11, 2005, 2:22 PM
shimtannyPosted Jan 10, 2005, 7:38 AM
pl1Posted Jan 7, 2005, 9:14 AM
shimtannyPosted Jan 7, 2005, 6:53 AM