Question

suppose if i want to develop a windows chat application then a chat server need be developed and client too. after developing chat server apps we can run that apps in a machine and chat client will be running another pc. if those pc is not in same network suppose chat server run in a USA machine and one chat client run in Germany machine and another run in UK machine. in this situation how communication will happen using internet. all the nachine have access internet so how one chat client will login to chat server and how two chat client will communicate with each other. i just want to how data will transfer from one client to another client via chat server. please give me concept or it would be better if anyone give me a reference of a any good .net based chat application where chat server and chat client will be there.........thanks.

Was it helpful?

Solution

  1. WCF Web Service with the client polling the service (simple-basic scenario - easy to implement, not very efficient)

  2. WCF Duplex Web Service with the server updating clients when needed (a bit more complicated)

  3. TCP Socket-based solution, hardest to implement but permits much better control. There is a very good example in Matthew McDonald's book "Pro Silverlight 3"

OTHER TIPS

Generally? I don't see how this is related to C#, but client-server architecture looks like this:

Client <-----> Server

For something like you're describing where two or more clients communicate with each other, you're just talking about adding multiple clients:

Client A <----
              |
               ----> Server
              |
Client B <----

If Client A wants to send a message to Client B, then Client A sends the message to the server with some sort of information indicating that it's intended for Client B. The server then examines the message, determines that it's intended for Client B, then relays that message over its connection to Client B.

This is the fundamental definition of client-server architecture. There are more advanced architectures that mix client-server with peer-to-peer, such as Skype. In a hybrid system, the connection from the client to the server typically only carries control messages (authentication, etc.) and requests for information on how to contact another client directly. The advantage to an approach like this is that it doesn't require all of the communication between A and B to flow through the server; A and B both connect to the server, but they then ask the server how to connect to each other directly, then use that direct connection for the bandwidth-intensive communication.

That's all an aside, really, though. You should read up on client-server architecture independent of any particular language or environment before you start down the road of developing an application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top