How to shut down Remoting service?

goodmorningsky

Well-known member
Joined
Aug 18, 2003
Messages
172
I start Hosting Remoting service in Form by calling
RemotingConfiguration.Configure("ComponentHostServer.exe.config");

I want to stop service by clicking stop button without terminating Form.
How can I do this?

following is part of my code.


Code:
private void btStart_Click(object sender, System.EventArgs e)
		{
			startService();
		}
		private bool startService()
		{
			RemotingConfiguration.Configure("ComponentHostServer.exe.config");
			addMsg("Service started : " + DateTime.Now.ToString("F", DateTimeFormatInfo.InvariantInfo)
				+"\nListening for client requests ...");
			return true;
		}
		private void addMsg(string msg)
		{
			string sep = "\n";
			rhTBox.Text = rhTBox.Text + sep + msg;
		}

		private void btStop_Click(object sender, System.EventArgs e)
		{
			//how to write code here?
		}
 
Back
Top