tags:

views:

252

answers:

2

Please forgive my limited knowledge of WCF, but I hope my inexperience with this platform simply means that my idea can be implemented and I just haven't learned out how to do it.

In the simpliest terms, I'd like to write two apps, one running as the master (service) and the other running the client. The catch is, the master service app needs to run on any basic PC - mostly by people on their home PCs without any hosting or web services configured. For example, it'll need to run on Vista Home Basic at a residential house on a standard broadband cable modem connection by someone with zero IT knowledge. A second catch is that each service application should be separate from any other service applications that may also be exposed to the Internet at the same time. Think of it like a chat room application where one person has the ability to start a chat session on their home PC. Then, others can connect to that session from the Internet (by using log in information provided by other means - i.e. email, phone, text, etc.) and all can exchange messages. Someone running only the client can't create the chat session and can only start the client if they have the proper session ID. As mentioned, if some other person starts the same service application on their home PC with a different session ID, then only those looking for that session will be able to connect and see messages for that session. There's an infinite number of possibilities for how the PCs running the service application might be configured as far as firewalls and available ports to the Internet, so I assume using a basic HTTP binding is needed?

So, the question is, what the best way to implement this...or, can this idea even be accomplished? It just seems to me that the service application would have no publically available address for the clients to find wthout some sort of server-style configuration. I looked heavily into the new .NET Services Service Bus, which allows a service endpoint to be exposed on the cloud (and I got it to work in a basic fashion), but it really seems like overkill for what is intended to be a very simple application suite. I looked at self-hosting configurations and the PeerChannel classes, but I'm not sure they can accomplish what I'm after.

Of course, the client side implementation should be very straightforward as long as there's a way to expose the service to the Internet.

Again, sorry about the lack of knowledge. Maybe (hopefully?) this is a easy thing to accomplish.

Thanks,

Steve E.

+1  A: 

Its simple enough to do in WCF. Your "client" apps (the ones sitting on a user's PC) would be able to connect to, or host, a chat room. WCF can do this without any major hassles... EXCEPT that the apps would have to be able to connect to the internet. Usually this means the user will have to allow the app to change the firewall's configuration.

In order for users to find each other you'd have to provide a service where users can broadcast their chat rooms and find rooms created by others. This can be achieved by a central server which has an address known by the client software.

10k foot view:

  1. User installs chat client.
  2. Chat client asks for elevation, user agrees, client configures the firewall.
  3. Chat client checks with central server for rooms.
  4. User joins a chat room.
  5. User creates a room, chat client notifies the central server of a new room.
  6. Other clients find the room on the server and connect directly with the user.
  7. User shuts chat room down, the chat client notifies central server that the room is no longer available.

Hardest part is figuring out how to handle ports and altering the firewall without bugging the user every time you want to connect to another chat client (which will probably be on a different port).

Will
A: 

Thanks for the quick reply...

I was assuming that there'd be some user PC-side prompts due to software firewalls. For now, I'm OK with that considering most average users are kind of used to seeing Windows prompt them for approval when apps try to access the internet. I was hoping to be able to use a single endpoint and assumed that meant a single port for the open channel. Was this a wrong assumption? Does each client connect to all other clients in the chat room using a different port even though it's all the same channel?

Part of that solution that I was hoping to avoid is the need to provide a web-based service to manage the chat rooms. While this is a last-ditch possibility, I was hoping for a completely server-less setup.

I'm looking at the PNRP and PeerChannel technologies more heavily right now. This also looks promising, but I'm still learning about it. Do you know anything about PNRP and direct connections with WCF?

Steve E