views:

693

answers:

2

I need to create a silverlight chat application. I know that there is a library called Japper-net but it only works for .NET applcations and not for silverlight. My question is: Is there any free XMPP/Jabber client library for Silverlight?

A: 

Unless you control the Jabber server, and can change the port at which it listens, you'll have some trouble talking to it with Silverlight, since Silverlight is restricted to talking to ports 4502-4532, and most public Jabber servers listen on ports 5222, 5223, 5269, and 8010. So there's not a lot of benefit for most folks to port Jabber.Net to Silverlight.

On the other hand, if you're just looking for a quick-and-dirty way to implement a chat application, and you don't care about interoperating with other Jabber servers, there are a ton of examples out there that you should be able to modify pretty quickly. See, for instance, here.

Ken Smith
Thank you so much. In fact, I care about interoperating with other Jabber servers cause my silverlight application is hosted on a shared webhosting server, I can't administrate it, I can't install windows services or server applications into it I can't also modify its security policies. so, do you have any good idea to get around this problem and let my app work with jabber servers?
Mohammed El-Gouhary
The only thing I can think of would to write a WCF web service that acts as a proxy with the Jabber servers. Effectively, you would wrap the Jabber.Net class with some WCF-callable methods, so that when you called the WCF method from your Silverlight client, the WCF service would turn around and make the Jabber call directly for you. There are potentially some issues with that, since WCF services are typically stateless, but you could potentially work around that with some creative use of static classes.
Ken Smith
A: 

I'm afraid you're kinda screwed if you can't change the security policies. If you can configure the jabber server on your provider to service the silverlight port range, (That's a security policy thing, from jabber's point of view it's just a configuration file) then you're happy, otherwise it won't work.

You could also use BOSH/XMPP, but i suspect i/you will have to write my/your own library for it. (I'm doing roughly the same thing)

Dan