Change the Rules


Silverlight 4 – Networking
Mike Taulty, Microsoft UK
mtaulty@microsoft.com
mtaulty.com
@mtaulty
browser launched, rich internet apps
have limited local access




                     files    hardware

                   software      ...
different types of Silverlight 4 apps
rich, controlled network access is key


firewall
being network aware is useful
all network access is asynchronous
      your code
                         not your code
network stack sketch
lots of capabilities to choose from
 • network protocols
     – HTTP, TCP, UDP
 • data encodings
     – text, binary
 • da...
and two key classes for HTTP itself




  • WebClient
     – simple, easier to use
  • (Http)WebRequest
     – more functi...
cross-domain security policy
there are two http stacks

                          verbs: GET, POST
                          automatic cookie managemen...
switching between stacks
Change the Rules




demo
reaching out with HTTP
lots of capabilities to choose from
 • network protocols
     – HTTP, TCP, UDP
 • data encodings
     – text, binary
 • da...
sockets
 • support for streaming TCP sockets
    – Silverlight is a socket client, not a server
    – consider WCF netTCP ...
sockets
 • support for multicast UDP sockets
   – both single source & any source multicasting
 • programmability is via
 ...
multicast security




for any source multicasting, the Silverlight client multicasts to the multicast group on
port 9430 ...
Change the Rules




demo
reaching out with sockets
lots of capabilities to choose from
 • network protocols
     – HTTP, TCP, UDP
 • data encodings
     – text, binary
 • da...
WCF subset in Silverlight for HTTP/TCP
 •   transports       - HTTP(S) and TCP
 •   encodings        - text and binary
 • ...
Change the Rules




demo
reaching out with WCF via HTTP/TCP
lots of capabilities to choose from
 • network protocols
     – HTTP, TCP, UDP
 • data encodings
     – text, binary
 • da...
RESTful services ( generically )


                                                          Resources
                   ...
RESTful services ( more specifically )
 • Open Data Protocol ( odata )
    – www.odata.org
    – published under the Open ...
WCF Data Services ( “Astoria” )
• implementation of odata for the client and the server
   http://server/customers(‘alfki’...
Change the Rules




demo
reaching out with WCF Data Services
resources
 • Channel 9 Silverlight 4 MEF Screencasts
   – channel9.msdn.com/tags/SL4Networking
 • Silverlight .NET
   – ww...
thank you for coming – please provide feedback


                               
Change the Rules


Silverlight 4 – Networking
Mike Taulty, Microsoft UK
mtaulty@microsoft.com
mtaulty.com
@mtaulty
Upcoming SlideShare
Loading in...5
×

Mike Taulty DevDays 2010 Silverlight 4 Networking

1,295

Published on

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,295
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Mike Taulty DevDays 2010 Silverlight 4 Networking

  1. 1. Change the Rules Silverlight 4 – Networking Mike Taulty, Microsoft UK mtaulty@microsoft.com mtaulty.com @mtaulty
  2. 2. browser launched, rich internet apps
  3. 3. have limited local access files hardware software ...
  4. 4. different types of Silverlight 4 apps
  5. 5. rich, controlled network access is key firewall
  6. 6. being network aware is useful
  7. 7. all network access is asynchronous your code not your code
  8. 8. network stack sketch
  9. 9. lots of capabilities to choose from • network protocols – HTTP, TCP, UDP • data encodings – text, binary • data serialization – XML, JSON, RSS, ATOM • messaging protocols – SOAP, REST, OData • messaging patterns – request  response, duplex, multicast • programming models – raw HTTP, WCF, WCF Data Services, sockets • security – cross-site, authentication, cross-scheme
  10. 10. and two key classes for HTTP itself • WebClient – simple, easier to use • (Http)WebRequest – more functionality, slightly more complex code
  11. 11. cross-domain security policy
  12. 12. there are two http stacks verbs: GET, POST automatic cookie management ( restricted ) set of request headers automatic authentication status codes: LIMITED ( 200, 400 ) verbs: ALL manual cookie management ( restricted ) set of request headers response headers & body authentication ( code & automatic ) status codes: ALL
  13. 13. switching between stacks
  14. 14. Change the Rules demo reaching out with HTTP
  15. 15. lots of capabilities to choose from • network protocols – HTTP, TCP, UDP • data encodings – text, binary • data serialization – XML, JSON, RSS, ATOM • messaging protocols – SOAP, REST, OData • messaging patterns – request  response, duplex, multicast • programming models – raw HTTP, WCF, WCF Data Services, sockets • security – cross-site, authentication, cross-scheme
  16. 16. sockets • support for streaming TCP sockets – Silverlight is a socket client, not a server – consider WCF netTCP as a better option • security – limited to ports 4502 to 4534 – policy file authorisation required - HTTP or TCP download – these restrictions do not apply to trusted applications
  17. 17. sockets • support for multicast UDP sockets – both single source & any source multicasting • programmability is via – Udp[Single/Any]SourceMulticastClient classes • security – port numbers must be above 1024 – policy file authorisation required – UDP download – these restrictions do not apply to trusted applications
  18. 18. multicast security for any source multicasting, the Silverlight client multicasts to the multicast group on port 9430 and waits for an authorisation
  19. 19. Change the Rules demo reaching out with sockets
  20. 20. lots of capabilities to choose from • network protocols – HTTP, TCP, UDP • data encodings – text, binary • data serialization – XML, JSON, RSS, ATOM • messaging protocols – SOAP, REST, OData • messaging patterns – request  response, duplex, multicast • programming models – raw HTTP, WCF, WCF Data Services, sockets • security – cross-site, authentication, cross-scheme
  21. 21. WCF subset in Silverlight for HTTP/TCP • transports - HTTP(S) and TCP • encodings - text and binary • serialization - DataContract* & XmlSerializer* • protocols - WS-I Basic Profile 1.1 – XML, HTTP, SOAP and WSDL – SOAP 1.2, WS-Addressing 1.0, WS-Security* • patterns - req/resp, duplex*, polled duplex* • privacy - HTTPS • authN - transport or message credential • faults - only available on the client stack
  22. 22. Change the Rules demo reaching out with WCF via HTTP/TCP
  23. 23. lots of capabilities to choose from • network protocols – HTTP, TCP, UDP • data encodings – text, binary • data serialization – XML, JSON, RSS, ATOM • messaging protocols – SOAP, REST, OData • messaging patterns – request  response, duplex, multicast • programming models – raw HTTP, WCF, WCF Data Services, sockets • security – cross-site, authentication, cross-scheme
  24. 24. RESTful services ( generically ) Resources HTTP Request URL Res 1 VERB GET Res 2 Payload POST Res 3 PUT Res 4 XML JSON DELETE HTTP Response Status Payload XML JSON
  25. 25. RESTful services ( more specifically ) • Open Data Protocol ( odata ) – www.odata.org – published under the Open Specification Promise • Extends the AtomPub standard to add – an addressing scheme – a mechanism for schema – alternate representation – JSON – handling for concurrent updates – handling for batched requests
  26. 26. WCF Data Services ( “Astoria” ) • implementation of odata for the client and the server http://server/customers(‘alfki’)/Orders?$top=20
  27. 27. Change the Rules demo reaching out with WCF Data Services
  28. 28. resources • Channel 9 Silverlight 4 MEF Screencasts – channel9.msdn.com/tags/SL4Networking • Silverlight .NET – www.silverlight.net
  29. 29. thank you for coming – please provide feedback  
  30. 30. Change the Rules Silverlight 4 – Networking Mike Taulty, Microsoft UK mtaulty@microsoft.com mtaulty.com @mtaulty
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×