8 replies
by amoljpatil
Basically, to do this, service have to expose an object through remoting. Then, you can get a proxy object of the service and execute methods of that service.
Try in this manner.
Hope this will work.
Cheers,
Amol
by netsecsvc
Yes, some code would have helped ... this is what I came up with in the service executable:
tc=new TcpChannel(8888);
ChannelServices.RegisterChannel(tc);
RemotingConfiguration.RegisterWellKnownServiceType(typeof Log),"NSS_Syslog",WellKnownObjectMode.Singleton);
logger=(Log)Activator.GetObject(typeof Log),"tcp://localhost:8888/NSS_Syslog");
logger.Start();
You've got to split waht the sevice does from controlling/monitoring it.
Take the gui out of the service.
ie have the gui and the service write to and read from a common store of some description.
Given you rea using a dataset, a common table / query stands out as an obvious solution.
by netsecsvc
Yes, some code would have helped ... this is what I came up with in the service executable:
tc=new TcpChannel(8888);
ChannelServices.RegisterChannel(tc);
RemotingConfiguration.RegisterWellKnownServiceType(typeof Log),"NSS_Syslog",WellKnownObjectMode.Singleton);
logger=(Log)Activator.GetObject(typeof Log),"tcp://localhost:8888/NSS_Syslog");
logger.Start();
by shri_ohm
Did you find solution? I am working with same problme. If you know solution please help me.
Thank You
Thought I'd given it.
Write the service with no gui.
Have it do it's stuff and save the results back to a table. Have another table for control of the service.
Then write you controlling/Monitoring GUI to read write to the Tables.
So if you had a GUI to say pause the service.
The sevice reads the service_control table and checks to see if paused is true, if so does nothing. The GUI reads paused from service control and displays and gives the user the facility to set it true or false. There are other ways than a table, but you need an area common to both application and service but completely independant. Just be careful about locking.
by netsecsvc
Well, actually the Dataset is simply inneficient for this. I learned to use NO DATASET in the service and to use STORED PROCEDURES (i.e. execute nonquery) to add each new record directly to the database. The GUI of course is using a dataset but in order to make it efficient, it is created by a "filtered" data adapter. In other words, that data adapter uses a SQL query that selects the top 100 records or so, instead of all records.
by netsecsvc
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending