quick NEWBIE on remoting :)

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?
 
M

Mr. Arnold

Somebody said:
So I'm learning remoting. Not really in depth, just a general overview, I
know its been replaced by WCF.

Then that should tell you to stop dead in your tracks and figure out how to
do WCF TCP/IP(Remoting) client/server.
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."

You marshal the object over to the server side as a known type object
between the two, meaning the object must be instantiated on the server side
using an Interface that the client and server can reference. You instantiate
the object marshal it from the server side sending the object to the client
side, the client side works with the object, and the client sends it back to
the server side.


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4501 (20091012) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
S

Somebody

So clients can get access to the object all day long by creating the
You marshal the object over to the server side as a known type object
between the two, meaning the object must be instantiated on the server
side using an Interface that the client and server can reference. You
instantiate the object marshal it from the server side sending the object
to the client side, the client side works with the object, and the client
sends it back to the server side.

Can you explain this a little more?

The client piece creates a ChatProxy object using remoting on the server.
Thats all fine and dandy, but that code is actually running in the proxy DLL
right? It doesn't seem like the server piece has access to any common area
with that proxy DLL.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top