S
Somebody
So I'm learning remoting. Not really in depth, just a general overview, I
know its been replaced by WCF.
Anyways, I'm learning it by writing a quick, very basic chat room type deal.
Here is my high level setup:
Server Piece: registers the service, has a button to start/stop listening on
the port
Proxy Piece: the class that does the work, has the sign on function, send
string, etc.
Client Piece: the part that the clients get... has the UI and calls the
proxy piece on the server.
I get all that. But how does the "Server Piece" get a reference to the
object? I register it like this:
m_channel = new TcpServerChannel(1234);
ChannelServices.RegisterChannel(m_channel, false);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(Proxy.ChatProxy),
"ChatProxy", WellKnownObjectMode.Singleton);
So clients can get access to the object all day long by creating the object,
thats cool, but how does "Server Piece" get access to it? The reason I'm
asking is because along with the start/stop button, I have a label that says
"There are x users logged on."
No idea how to get the user count onto the server UI
. There doesn't seem
to be any connection between the server piece and the singleton object. No
way to subscribe to an event or
anything.
One other question, the RegisterWellKnownServiceType() call doesn't have any
reference to the channel. How does Proxy.ChatProxy know what port its
assigned to? I.e. it doesn't seem like I can have service A run on port X
and service B run on port Y at the same time?
Any suggestions?
know its been replaced by WCF.
Anyways, I'm learning it by writing a quick, very basic chat room type deal.
Here is my high level setup:
Server Piece: registers the service, has a button to start/stop listening on
the port
Proxy Piece: the class that does the work, has the sign on function, send
string, etc.
Client Piece: the part that the clients get... has the UI and calls the
proxy piece on the server.
I get all that. But how does the "Server Piece" get a reference to the
object? I register it like this:
m_channel = new TcpServerChannel(1234);
ChannelServices.RegisterChannel(m_channel, false);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(Proxy.ChatProxy),
"ChatProxy", WellKnownObjectMode.Singleton);
So clients can get access to the object all day long by creating the object,
thats cool, but how does "Server Piece" get access to it? The reason I'm
asking is because along with the start/stop button, I have a label that says
"There are x users logged on."
No idea how to get the user count onto the server UI
![Smile :) :)](/styles/default/custom/smilies/smile.gif)
to be any connection between the server piece and the singleton object. No
way to subscribe to an event or
anything.
One other question, the RegisterWellKnownServiceType() call doesn't have any
reference to the channel. How does Proxy.ChatProxy know what port its
assigned to? I.e. it doesn't seem like I can have service A run on port X
and service B run on port Y at the same time?
Any suggestions?