ITCamp 2011 - Florin Cardasim - Duplex Communications with WCF and Azure

1,218 views
1,144 views

Published on

Published in: Technology, Business
1 Comment
0 Likes
Statistics
Notes
  • Demos: https://docs.google.com/leaf?id=0B8NpttvyIu_5NWRjYWMxOGItYmM3Ni00YzhjLTg2NTUtMTk3NWMxN2QwMWI5&hl=ro
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total views
1,218
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
20
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

ITCamp 2011 - Florin Cardasim - Duplex Communications with WCF and Azure

  1. 1. IT Camp 2011• Thanks for coming!• ITCamp is made possible by our sponsors: Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  2. 2. Duplex Communications with WCF and Azure Florin Cardașim, software developer RomSoft Iași, www.rms.ro caf@rms.ro | twitter.com/cardasimPremium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  3. 3. Session agenda• Enterprise duplex. Non-browser clients – WCF duplex bindings, router service – Windows Azure Service Bus• Web duplex. Browser clients – Simple polling, comet/long polling – WebSockets• Q&A Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  4. 4. Non-browser clients - WCF duplex bindings, router service - Windows Azure Service BusENTERPRISE DUPLEX Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  5. 5. Full duplex using WCF NetTcpBinding Event Full duplex TCP publisher Event consumer Publisher requires public IP Custom ports open in firewall Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  6. 6. “Full duplex” using WCF WSDualHttpBinding Event N publisher Duplex HTTP A Event T consumer Network address translation makes connection back impossible Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  7. 7. “Full duplex” using WCF WSHttpBinding Event publisher Dual HTTPEventconsumer Publisher and consumers require public IP That’s fine, BUT we want the servers INSIDE the enterprise Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  8. 8. WCF Router Service Router Service Router Service Dual HTTP TCP TCP EventEvent publisherconsumer Firewall and NAT friendly Routers have protocol bridging, failover etc Not bad, but quite crowded. Can you do better? Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  9. 9. Windows Azure Service Bus sb://itcampnamespace.servicebus.windows.net/publisher Relay Service Event Event consumer publisher Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  10. 10. Connecting the enterprises via:-NetTcpBinding, WsDualHttpBinding-RouterService, NetTcpBinding, WsDualHttpBinding-Service Bus, NetEventRelayBindingDEMO Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  11. 11. Enterprise duplex: conclusions• Direct TCP is best IF available • public endpoint , open ports in firewall• Duplex HTTP is an alternative • public IP both publisher and consumer, port 80• Router Service bridges the enterprises • flexible, but quite complicated deployment• Azure Service Bus • very flexible & powerful; requires careful planning because each connection costs money  Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  12. 12. Browser clients - Simple polling, comet/long polling - WebSocketsWEB DUPLEX Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  13. 13. Http polling• Wasted resources, many requests return no data• Frequent polling means higher load on the server Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  14. 14. Comet/long polling • Bandwidth: small payload, large http headers overhead • Scalability: pressure on memory, bandwidth, threads/processes Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  15. 15. An open source, WCF based, long polling server implementation:http://laharsub.codeplex.com/DEMO Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  16. 16. Html5 WebSockets• Full duplex, bidirectional Server• Single TCP socket• Standard ports: http/80, https/443• Bandwidth savings Client• More scalable than Comet• Nice programming model Drafts:• In&outside of browser -IETF WebSockets Protocol -W3C WebSockets API Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  17. 17. Html5/websockets: server• Socket.IO (Java, node.js) • Socket.IO Fallbacks – Adobe Flash Socket• Jetty (Java) – AJAX Long Polling• Ruby/EventMachine – AJAX Multipart• Python/Twisted Streaming – Forever iFrame• WCF websocket – JSONP Polling prototype • … others • http://socket.io/ Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  18. 18. Html5/websockets: server• Test browser support: http://websocket.org/echo.html• Microsoft is still experimenting  • http://html5labs.com Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  19. 19. Some WebSockets in action:http://kaazing.mehttp://retrospectiveapp.heroku.comDEMO Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  20. 20. Using the WCF WebSockets prototype from http://html5labs.comDEMO Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  21. 21. References• channel9.msdn.com/Learn/Courses/Azure/ServiceBus• en.wikipedia.org/wiki/Comet_%28programming%29• html5rocks.com/tutorials/websockets/basics• websocket.org• pusher.com• kaazing.com• live.visitmix.com/MIX11?q=web+sockets• paulbatum.com Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  22. 22. Q&A Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro
  23. 23. Don’t forget!Get your free Azure pass! We want your feedback!• 30+15 days, no CC req’d • Win a WP7 smartphone – http://bit.ly/ITCAMP11 – Fill in your feedback forms – Promo code: ITCAMP11 – Raffle: end of the day Premium conference on Microsoft’s Dev and ITPro technologies @itcampro / #itcampro

×