SlideShare a Scribd company logo
Web Sockets are not
Just for Web Browsers
September 2013
About Me
 I am a software developer, based out of Phoenix, Arizona, that specializes in
.NET technology.
 Expert on just about all areas of MS.NET programming, but focused on, but
not limited to
 Connected Systems Technologies
 Windows Communication Foundation (WCF)
 BizTalk
 Windows Workflow Foundation (WF)
 SQL Server
 Senior Consultant for Neudesic, LLC
 President of Phoenix Connected Systems User Group
What the Heck
are they?
Web Sockets
Overview
We got a problem
Dilemmas With Traditional Methods Ladies and
Gents, We Have
a Solution
Solving the request response
dilemma
Where are the 1s and 0s:
Code Bits and Demonstration
Meat of the
Presentation:
Web Sockets beyond web
browsers
Wrap it Up
Already!
Conclusion, Questions
and Answers
But Why?:
Why Use Web Sockets Beyond
Web Browsers
3
1
2
What are Web Sockets?
 Web Sockets are a standard created by the
W3C as developed as a part of the HTML5
initiative
 RFC 6455 defines constraints for a protocol
 Bi-directional session-ful communication
between client and server
 Beats old school polling conventions
 Request Response Dilemma
 API for using Web Sockets
Key Take-Aways
Is it request response? Nope. It‟s Full duplex.
More on this later…
What Else?
Solves world hunger!!!!
…
Well, not really, but it‟s still pretty awesome
We Got a Problem Here:
Request / Response Dilemma
Request: I need „XYZ‟ resource
Response: Here is „XYZ‟ resource
Client Server
JavaScript Solutions
 How do we circumvent the fact that we can‟t receive events on the client
from the server?
 JavaScript polling
 Short Polling
 Client checks every so often for events and messages that the server has queued
 Long Polling
 Client makes 60 – 120 second connections to the server and waits for events during that
time
 If no events are received, the server closes the session
 Rinse and repeat
Short Polling
Long Polling
I bet you have a question right about
now…
What are we ever to do????
Please… let me catch my breath
Don‟t fret. Let me back up a second and catch my breath…
Web Sockets: The Solution to the
Request / Response Dilemma
 Web Sockets are full duplex
 Walkthrough of the process:
 Client establishes web socket connection to server
 4 minutes pass
 Server determines that an event needs to be sent to the client
 Event sent through established connection
 Problem solved!!
 Important takeaway: Connection is synchronous (connect > disconnect), but
messages are asynchronous
Solution Overview
Full duplex!
Full duplex from a web brower???
This is awesome!
Full duplex!
However, I won‟t believe it until I see it
Show me the code!
Web Sockets are not Just for Web
Browsers
 As of version 4.5, .NET WCF supports Web Sockets
 Web Sockets are easily implemented using the netHttpBinding
 Full Duplex services
 Existing service can quickly and easily add a netHttpBinding to the
configuration in order to implement this
 Shortly, I will show you just how that is done
You‟re probably wondering…
Wait a second Chris… You‟re telling me that I can use other applications other
than web browsers?
The Truth and Nothing but the Truth
Yes my friend. This is the magic of open source protocols.
“How?”, you ask. I‟ll show you how!
Show me the code again!
The Demo
Web Browser
WPF Client
Why Chris?
 Firewall benefits
 Web Sockets supported by most firewalls since the underlying protocol is via HTTP
 OSI Layer 5+ firewalls still support web sockets due to UPGRADE requests
 Platform agnostic protocol
 Protocol defined by W3C and not a single vendor
 Supports Java clients
 Supports .NET clients
 Supports Plethora of Platforms (Python, PHP, Perl)
 Services can be built once
 No more separate solutions for client type restrictions
 One service can support various clients
Multiple Clients and One Service
WPF Client
WCF Service
Metro Client
Web Browser
Client
Show me the code one last time!
 Demonstrations
 One service
 Windows 8 client
 WPF Client
 Web client walkthrough
Code and Slides
• Git Hug: https://github.com/jixer/wcf-windows-8-web-sockets/
• My Blog: http://www.bloggedbychris.com/2013/09/23/nwvdnug-web-sockets-
presentation/
PCSUG
 http://pcsug.org/
 Meeting at Interface now
 October 2nd, 2013: The Connected Systems Voyage - Charted and Uncharted
Territories
 Chris Myers, President, PCSUG
Questions?

More Related Content

PPT
Open Source
PDF
Reactive Guide for Spring MVC - Rossen Stoyanchev
PPT
Common Mistakes Made By Web Developers
PDF
Messaging is not just for investment banks!
PPTX
Slideshare - Magento Imagine - Do You Queue
PPTX
Component-driven development with AngularJS
PPTX
Knockout js with mvc
PDF
Wordpress vs html
Open Source
Reactive Guide for Spring MVC - Rossen Stoyanchev
Common Mistakes Made By Web Developers
Messaging is not just for investment banks!
Slideshare - Magento Imagine - Do You Queue
Component-driven development with AngularJS
Knockout js with mvc
Wordpress vs html

What's hot (18)

PDF
Introduction to Web Sockets
PPTX
PPTX
Single Page Applications: Your Browser is the OS!
PPTX
How I built a WebRTC enabled website in 20 minutes!
KEY
Learn to Code: SXSX 2012
KEY
Node.js Presentation Rotterdam.PHP
PPTX
Monitoring Servers, With a Little Help from my Bots
PDF
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
PPTX
How to make your functional tests really quick
PPTX
Aspect oriented programming
PDF
Appserver.io Imagine Presentation 2014
PDF
Magento on stereoids, Imagine 2014 Las Vegas
PDF
MJML presentation - PHP User group Sofia
KEY
Architecting single-page front-end apps
PDF
STAQ Development Manual (Redacted)
PPTX
Asynchrony on the web
PDF
Fast Websites: The What, Why, and How
PPTX
Copy of final webmailing
Introduction to Web Sockets
Single Page Applications: Your Browser is the OS!
How I built a WebRTC enabled website in 20 minutes!
Learn to Code: SXSX 2012
Node.js Presentation Rotterdam.PHP
Monitoring Servers, With a Little Help from my Bots
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
How to make your functional tests really quick
Aspect oriented programming
Appserver.io Imagine Presentation 2014
Magento on stereoids, Imagine 2014 Las Vegas
MJML presentation - PHP User group Sofia
Architecting single-page front-end apps
STAQ Development Manual (Redacted)
Asynchrony on the web
Fast Websites: The What, Why, and How
Copy of final webmailing
Ad

Similar to Web Sockets are not Just for Web Browsers (20)

PPTX
Web sockets are not just for web browsers
PPTX
Brewing Beer with Windows Azure - NDC2013
PDF
ServerSentEventsV2.pdf
PPT
HTTP Server Push Techniques
PPTX
video conference (peer to peer)
PDF
ServerSentEvents.pdf
PPTX
Production debugging web applications
PPTX
Building Realtime Web Applications With ASP.NET SignalR
PDF
WebSocket Push Fallback - Transcript.pdf
PPT
Vp nwebcast williams_wallaboswell
PPTX
Techdays 2012 - What is new in .NET 4.5 & Visual Studio 2012
PDF
Real time web
PPTX
Best practices of building data streaming API
PDF
Web Development Presentation
PPT
DevNext - Web Programming Concepts Using Asp Net
PDF
learn mvc project in 7 day
DOCX
It and ej
PPTX
Web socket with php v2
PPTX
Pentesting With Web Services in 2012
PPT
Programming Server side with Sevlet
Web sockets are not just for web browsers
Brewing Beer with Windows Azure - NDC2013
ServerSentEventsV2.pdf
HTTP Server Push Techniques
video conference (peer to peer)
ServerSentEvents.pdf
Production debugging web applications
Building Realtime Web Applications With ASP.NET SignalR
WebSocket Push Fallback - Transcript.pdf
Vp nwebcast williams_wallaboswell
Techdays 2012 - What is new in .NET 4.5 & Visual Studio 2012
Real time web
Best practices of building data streaming API
Web Development Presentation
DevNext - Web Programming Concepts Using Asp Net
learn mvc project in 7 day
It and ej
Web socket with php v2
Pentesting With Web Services in 2012
Programming Server side with Sevlet
Ad

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Cloud computing and distributed systems.
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
KodekX | Application Modernization Development
PDF
Electronic commerce courselecture one. Pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Unlocking AI with Model Context Protocol (MCP)
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Modernizing your data center with Dell and AMD
NewMind AI Weekly Chronicles - August'25 Week I
Encapsulation_ Review paper, used for researhc scholars
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Cloud computing and distributed systems.
Network Security Unit 5.pdf for BCA BBA.
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
KodekX | Application Modernization Development
Electronic commerce courselecture one. Pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Big Data Technologies - Introduction.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing

Web Sockets are not Just for Web Browsers

  • 1. Web Sockets are not Just for Web Browsers September 2013
  • 2. About Me  I am a software developer, based out of Phoenix, Arizona, that specializes in .NET technology.  Expert on just about all areas of MS.NET programming, but focused on, but not limited to  Connected Systems Technologies  Windows Communication Foundation (WCF)  BizTalk  Windows Workflow Foundation (WF)  SQL Server  Senior Consultant for Neudesic, LLC  President of Phoenix Connected Systems User Group
  • 3. What the Heck are they? Web Sockets Overview We got a problem Dilemmas With Traditional Methods Ladies and Gents, We Have a Solution Solving the request response dilemma Where are the 1s and 0s: Code Bits and Demonstration Meat of the Presentation: Web Sockets beyond web browsers Wrap it Up Already! Conclusion, Questions and Answers But Why?: Why Use Web Sockets Beyond Web Browsers 3 1 2
  • 4. What are Web Sockets?  Web Sockets are a standard created by the W3C as developed as a part of the HTML5 initiative  RFC 6455 defines constraints for a protocol  Bi-directional session-ful communication between client and server  Beats old school polling conventions  Request Response Dilemma  API for using Web Sockets
  • 5. Key Take-Aways Is it request response? Nope. It‟s Full duplex. More on this later…
  • 6. What Else? Solves world hunger!!!! … Well, not really, but it‟s still pretty awesome
  • 7. We Got a Problem Here: Request / Response Dilemma Request: I need „XYZ‟ resource Response: Here is „XYZ‟ resource Client Server
  • 8. JavaScript Solutions  How do we circumvent the fact that we can‟t receive events on the client from the server?  JavaScript polling  Short Polling  Client checks every so often for events and messages that the server has queued  Long Polling  Client makes 60 – 120 second connections to the server and waits for events during that time  If no events are received, the server closes the session  Rinse and repeat
  • 11. I bet you have a question right about now… What are we ever to do????
  • 12. Please… let me catch my breath Don‟t fret. Let me back up a second and catch my breath…
  • 13. Web Sockets: The Solution to the Request / Response Dilemma  Web Sockets are full duplex  Walkthrough of the process:  Client establishes web socket connection to server  4 minutes pass  Server determines that an event needs to be sent to the client  Event sent through established connection  Problem solved!!  Important takeaway: Connection is synchronous (connect > disconnect), but messages are asynchronous
  • 15. Full duplex! Full duplex from a web brower??? This is awesome!
  • 16. Full duplex! However, I won‟t believe it until I see it
  • 17. Show me the code!
  • 18. Web Sockets are not Just for Web Browsers  As of version 4.5, .NET WCF supports Web Sockets  Web Sockets are easily implemented using the netHttpBinding  Full Duplex services  Existing service can quickly and easily add a netHttpBinding to the configuration in order to implement this  Shortly, I will show you just how that is done
  • 19. You‟re probably wondering… Wait a second Chris… You‟re telling me that I can use other applications other than web browsers?
  • 20. The Truth and Nothing but the Truth Yes my friend. This is the magic of open source protocols. “How?”, you ask. I‟ll show you how!
  • 21. Show me the code again!
  • 23. Why Chris?  Firewall benefits  Web Sockets supported by most firewalls since the underlying protocol is via HTTP  OSI Layer 5+ firewalls still support web sockets due to UPGRADE requests  Platform agnostic protocol  Protocol defined by W3C and not a single vendor  Supports Java clients  Supports .NET clients  Supports Plethora of Platforms (Python, PHP, Perl)  Services can be built once  No more separate solutions for client type restrictions  One service can support various clients
  • 24. Multiple Clients and One Service WPF Client WCF Service Metro Client Web Browser Client
  • 25. Show me the code one last time!  Demonstrations  One service  Windows 8 client  WPF Client  Web client walkthrough
  • 26. Code and Slides • Git Hug: https://github.com/jixer/wcf-windows-8-web-sockets/ • My Blog: http://www.bloggedbychris.com/2013/09/23/nwvdnug-web-sockets- presentation/
  • 27. PCSUG  http://pcsug.org/  Meeting at Interface now  October 2nd, 2013: The Connected Systems Voyage - Charted and Uncharted Territories  Chris Myers, President, PCSUG