C
Charles Law
I've read numerous articles and bits of code that purport to do this, but I
think there is a gap somewhere (quite possibly in my head).
I have a server, which is actually a Windows service. I also have a client
that needs to retrieve information from this service, but also needs to
receive events from it, when it (the client) is running. I've done all the
MBO stuff, and the client can pick up info from the server at will. That was
the easy bit.
Now, I want the service/server to be able to raise an event, and the client
to handle it. The sticking point seems to be: How do I raise the event in
the server? It seems to me that in order to do that I need a reference to
the MBO on which the event is to be raised. In my server I have
Dim identifier As String = "MyServer"
Dim mode As WellKnownObjectMode = WellKnownObjectMode.Singleton
Dim entry As WellKnownServiceTypeEntry
entry = New WellKnownServiceTypeEntry(GetType(MyServerMBO), identifier,
mode)
RemotingConfiguration.RegisterWellKnownServiceType(entry)
But how do I get a reference to the MyServerMBO that is created?
I have tried making everything Shared, so that I don't need a reference, but
although I can see the RaiseEvent call being made, the debugger steps right
over it, indicating that there is nothing attached to it, and the client
never receives a call.
Have I missed something here?
TIA
Charles
think there is a gap somewhere (quite possibly in my head).
I have a server, which is actually a Windows service. I also have a client
that needs to retrieve information from this service, but also needs to
receive events from it, when it (the client) is running. I've done all the
MBO stuff, and the client can pick up info from the server at will. That was
the easy bit.
Now, I want the service/server to be able to raise an event, and the client
to handle it. The sticking point seems to be: How do I raise the event in
the server? It seems to me that in order to do that I need a reference to
the MBO on which the event is to be raised. In my server I have
Dim identifier As String = "MyServer"
Dim mode As WellKnownObjectMode = WellKnownObjectMode.Singleton
Dim entry As WellKnownServiceTypeEntry
entry = New WellKnownServiceTypeEntry(GetType(MyServerMBO), identifier,
mode)
RemotingConfiguration.RegisterWellKnownServiceType(entry)
But how do I get a reference to the MyServerMBO that is created?
I have tried making everything Shared, so that I don't need a reference, but
although I can see the RaiseEvent call being made, the debugger steps right
over it, indicating that there is nothing attached to it, and the client
never receives a call.
Have I missed something here?
TIA
Charles