views:

335

answers:

3

I need to embed chat functionality into .NET application (Windows client app).

Requirements:

  • Preferably server-less/zero-config architecture (p2p), but not required
  • Based on open standards (XMPP alike)
  • Implementation (library) for .NET (native C/C++ is OK too) exists

What can you recommend? Currently I'm looking at XMPP/Jabber, do you have any experience using it in your apps?

+1  A: 

uhhh, if you really want to do server less architecture for a chat application you need to evaluate carefully what kind of functionality you want to offer. For example, do you want one-on-one chat only, how about group chats, status notifications, what about user authentication? there are many ways to go about this, yet personally I would always favor a server based solution for this.

Anyways, the most basic solution would be to use UDP multicast, every client is a sender and receiver. UDP is not reliable, so your senders should cache the messages and your application level protocol should be able to detect gaps, be able to request gap fill data and order incoming data into sequence. In that scenario, basically everybody would see everybody's messages (this could be filtered on the application level protocol).

The next best solution would be that every client sends multicast beacons (announcements) and if a client is interest to initiate a conversation with a certain sender, it would look at the beacon which should contain info about the sender including an IP address and port. The interested party would then establish a TCP connection to the beacon sender and those two parties can now start to chat with each other directly with guaranteed and ordered message delivery.

I could go on now with more advanced messaging architectures/protocols but I don't think that makes sense.

If I had your requirements I would get something like http://www.coversant.net/Product/SoapBoxServer.aspx (they have a free express edition, everything is built in .NET, .NET API provided, etc.) or get any other XMPP server (here's a couple: http://xmpp.org/software/servers.shtml) with a .NET API like http://code.google.com/p/jabber-net/

Tom Frey
@Tom, thanks for feedback. I know how these things work. I just want to get feedback from somebody who has experience with mentioned protocols\technologies. My #1 goal is simplicity - ideally clients shouldn't do any setup. Second goal is reliability, if server goes down I want my clients to keep talking. XMPP seems to be the best choice. I'm evaluation existing XMPP implementations right now.
aku
A: 

I'm not sure about serverless, since I hosted the OpenFire jabber server, but this Jabber.NET library worked well for me.

kenny
A: 

There is a solution for 2 clients each behind a firewall.

Google for Upd Punchthrough.

It requires a central server for the initiation though, but after that the server is not needed anymore.

Rabarber