views:

334

answers:

2

Hi, I am trying to implement a Silverlight 2 client application that takes data from a server via socket-based communication.

I've heard that in Silverlight 2, this process is more complicated due to the fact that it is required to use a policy server, and that could slow down my application, not to mention that each string passed through the socket would have to be checked with the policy server.

I'm wondering if this is indeed the case, and if writing the server is going to be a mammoth task. Do you recommend staying with Silverlight 1? I'm aware that in Silverlight 1, socket communication has to be done in ASP.NET. I was aiming for the client logic to be done in C#, but with Silverlight 1, I believe I can only use Javascript and communicate with ASP.NET...

Thanks for any replies!

+1  A: 

According to documentation, you can use sockets to connect to the server the Silverlight app was downloaded from right away. If you need to connect using sockets to another server, you need to supply a policy file.
This MSDN article describes how to create the policy file.

Sander Rijken
I doubt it, from the article you linked to, it seems that security policy system for sockets affects both site-of-origin and cross-domain network access. In S2B1, this wasn't the case, but I want to use the finished/shipped/most recent version.
Jean Azzopardi
It seems that's only the case if the silverlight policy file isn't found:"If a Silverlight policy file is not found, the Silverlight 2 runtime then tries to download a Flash policy named "crossdomain.xml" at the root of the requested target domain using the HTTP protocol."
Sander Rijken
A: 

I've thought a bit and I'm going to use ASP.NET to connect with the server with sockets, and then use WebClient access to connect to the webserver, no policies required as it's site-of-origin. I still have to build an html page that provides similar functionality to the SL 2 client, so it's not much of a big deal.

Jean Azzopardi