On the server is call:
HttpChannel chan = new HttpChannel(4544);
ChannelServices.RegisterChannel(chan);
Type myObjectType = typeof(myObject);
RemotingConfiguration.RegisterWellKnownServiceType (myObjectType,"EndPointName",
WellKnownObjectMode.SingleCall);
and on the Client Call:
HttpChannel chan = new HttpChannel(0);
ChannelServices.RegisterChannel(chan);
myObjectInterface r =
(myObjectInterface)RemotingServices.Connect(typeof (myObjectInterface),"http://localhost:4544/EndPointName");
My Client app has a Class which is the interface of the object i am
sharing and the server app has the full object class.
I normally have the client using a interface rather than the full class
so if i change the internals of the class then i dont need to
redistribute the client.
Beeeeeeeeeeeeves wrote:
Wouldn't mind seeing some of your examples of using remoting to do simple communication between client and server if you have any.
Also would be interested in seeing ones of a service communicating with a front end app on the same machine.
mail me to benjtaylor at hotpop dot com if you have any good examples
"Arran Pearce" wrote:
Remoting is a good answer. Use the Http Channel. Very easy to code,
only about 5 lines on client and server.
Another option is to use System.IO and setup some UDP or TCP sockets.
This is also quite easy.
If you need some code examples mail me.
Christian Westerlund wrote:
Hi!
Does anyone know if it is possible for a client server communication
easy in .NET with these requirements:
The client always initiates the communication
The server only answers (responds)
Uses port 80, skips firewall
The server computer doesn't have a IIS or web server
I have thought about remoting but it feels a little bit over the top, we
are only sending information to the client .
/Christian