Hi All,
I have a Windows Service that runs well. The service hosts a remote object.
The purpose of the object is so that I can "peak" into the service to see
what it's doing. I wrote a small Windows Application that connects to the
remote object and prints out status information.
Everything works fine when I first start the service. However, after some
period, when I attempt to connect to the remote object, I get "Requested
Service not Found" when I try to bind to it.
I can confirm that the Service is still running, because it is doing what it
is supposed to be doing (processing logfiles) but the Remote Object isn't
working. The Remote Object is instantiated in the main thread for the
service, so it's not that the remote object is getting destroyed.
Some more troubleshooting shows that it isn't on the second connection
attempt that I cannot connect. I thought it might be the local object
destroying the remote object when the "client" app closes. This doesn't seem
to be the case.
The instance of the remote object is populated by the service with
information as it is running. So I'm fairly certain the the actual instance
of the object still exists, because if it was destroyed, then the service
would probably crash, which it doesn't.
Anyone have any ideas on what I'm doing wrong or not doing?
Here is the server side code that creates the object: (Object name is
"AllStatus")
HttpChannel channel = new
HttpChannel(Convert.ToInt32(ConfigurationSettings. AppSettings["StatusPort"])
);
ChannelServices.RegisterChannel(channel);
ObjRef refl = RemotingServices.Marshal(AllStatus,"objectluri");
Here is the client code that attempts to connect to it:
string RemoteConnection = "http://" + this.textBox1.Text + ":" +
this.textBox3.Text + "/objectluri";
RemotingConfiguration.RegisterWellKnownClientType( typeof(SessionLogger.Servi
ceStatus),RemoteConnection );
object1 = new SessionLogger.ServiceStatus();
To get the obvious questions out of the way, yes, I'm sure that the host and
port numbers are the same.
Thanks in Advance..
Steve