G
Guest
Hello,
I've been reading up on IPC and looking at sample code, and I can't seem to
figure out how to actually accomplish communication from a client to a
server. I understand the concept of a server hosting a dll which contains a
method that the client can call. However, how can the server also obtain a
reference to the same object? I want the client to be able to send a message
that makes it to where the server can use it.
To clarify my question, the examples I've seen so far have been like this:
Server creates a channel exposing Class A.
Class A contains a handy-dandy method that can multiply two ints.
Client creates a channel to be able to instantiate a new Class A object and
call its methods.
But how does Client get a message all the way back to Server?
I tried creating a client channel in the server itself, but I can't make
that work. I get an exception saying that there is already a registered
object for that channel. I also tried creating an instance of Class A in the
server, but it was a completely separate object that did not see messages
that the client put into it.
To give some context, I have a Windows service that needs to be controlled
via a Windows Forms app. As I understand it, to get messages to the Windows
service, I would create a channel there and have the Forms app be the client.
But how do I actually retrieve the messages from within the service?
Apparently IPC is the way to go for on-box communication, but I haven't seen
any examples showing how to get a client and server to exchange actual
messages. Please help!
Brian
I've been reading up on IPC and looking at sample code, and I can't seem to
figure out how to actually accomplish communication from a client to a
server. I understand the concept of a server hosting a dll which contains a
method that the client can call. However, how can the server also obtain a
reference to the same object? I want the client to be able to send a message
that makes it to where the server can use it.
To clarify my question, the examples I've seen so far have been like this:
Server creates a channel exposing Class A.
Class A contains a handy-dandy method that can multiply two ints.
Client creates a channel to be able to instantiate a new Class A object and
call its methods.
But how does Client get a message all the way back to Server?
I tried creating a client channel in the server itself, but I can't make
that work. I get an exception saying that there is already a registered
object for that channel. I also tried creating an instance of Class A in the
server, but it was a completely separate object that did not see messages
that the client put into it.
To give some context, I have a Windows service that needs to be controlled
via a Windows Forms app. As I understand it, to get messages to the Windows
service, I would create a channel there and have the Forms app be the client.
But how do I actually retrieve the messages from within the service?
Apparently IPC is the way to go for on-box communication, but I haven't seen
any examples showing how to get a client and server to exchange actual
messages. Please help!
Brian