Library - Client Access Policy server

[title]Client Access Policy server[/title]
This is a simple Client Access Policy server that’ll run on a FEZ Cobra. It’ll present the POLICY_REQUEST_XML as the “website” policy file.

This is useful if you want to be able to connect to your FEZ device from a Silverlight application. Silverlight is a great web applet development solution for people who are used to C# and want to try and create a basic web applet that doesn’t require an advanced server solution to use (you can host it using a free Dropbox account).

The usage example shows how to send and receive. This can easily be expanded to show various inputs live in a Silverlight form.

@ Josh
Hmm, this code is not linked back to this thread as well.

Other than that - nice example! Thanks

You mean josh? :slight_smile:

Sorry, was just talking to a guy named Jeff. Typed it automatically. :-[

i have made basically the same example, except i used flash. I am learning silver light now to replace flash. Just as an FYI you dont need to use the default port 943 for the policy file request.

You can use port 80 instead.


instead of


Just in case you didnt know, but i bet you do.

Thanks for pointing it out and yeah, I knew, but I figured this way this policy server will run “out of the box” as Silverlight defaults to the TCP protocol.

no prob, but it will run out the box either way using TCP, and its one less port to open for the client :wink:

From the testing I’ve done, Silverlight always uses SocketClientAccessPolicyProtocol.Tcp unless you explicitly tell it to use SocketClientAccessPolicyProtocol.Http. I might be wrong I guess.

Also, it’s only one more port to open if you’re also planning to run the web server on the FEZ, which in my opinion would be a bit silly as there are plenty other much better solutions for that. The idea with this library is that you’ll have the FEZ collecting data, and streaming it live to a Silverlight application running somewhere else, minimizing the work load of the FEZ and maximizing the potential of socket communication between server and client.

You are absolutely correct here,

ya, make a web server on the FEZ, so when you connect to it via your browser, it will serve up you silverlight app to the PC. then when it starts running on the client computer it will make the TCP connection back to the FEZ so they can start exchanging data back and forth in near real time.

P.S. please dont think that i am harping on ya, I am not doing that at all, great job by the way with the example.