TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
pl1
NA
15
0
Proble with ClientSponsor
Jan 7 2005 5:13 AM
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();
Reply
Answers (
13
)
To bind to Datagrids
c# - redirecting in usercontrol