Client - server communication

  • Thread starter Christian Westerlund
  • Start date
C

Christian Westerlund

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
 
A

Arran Pearce

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.
 
E

Elp

Arran Pearce said:
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.

And another option would be to use a Web Service with WSE 2.0 (now in
release version) which allows to host a Web Service within a Windows
executable without the need of a Web Server.Here is a link to a good article
that explains that, unfortunately in French:
http://www.c2i.fr/code.aspx?IDCode=576
You can find information in English here:
http://msdn.microsoft.com/webservices/building/wse/ (the feature i'm talking
about is Web Service Messaging)

I guess however that the Remoting way with HTTP channel would be much easier
and more powerfull although not interroperable (but i'm not sure if WSE 2 is
that much interroperable either)
 
A

Arran Pearce

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.
 

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