+ All Categories
Home > Documents > Web sockets are not just for web browsers

Web sockets are not just for web browsers

Date post: 18-Jul-2015
Category:
Upload: cjmyers
View: 2,139 times
Download: 0 times
Share this document with a friend
Popular Tags:
29
Web Sockets are not Just for Web Browsers November 2012
Transcript

Web Sockets are not

Just for Web BrowsersNovember 2012

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

VP of Phoenix Connected Systems User Group

What the Heck

are they?Web Sockets

Overview

We got a problemDilemmas With Traditional Methods Ladies and

Gents, We Have

a SolutionSolving 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

Northwest Valley .NET User Group

Upcoming Meetings:

Scott Williams: Backbone

Fundamentals

Benton Hoelting: TBD

Rick Garibay: Microsoft‟s

Implementation of the

HTML5 WebSockets API

Phoenix Connected Systems User

Group• First Wednesday of

every month @5:30 P.M.

• Microsoft office off of Tempe town lake

• www.pcsug.org

• Twitter: @pcsug

Past Speakers:• Glenn Block: Unlock your

Inner Node.js in the Cloud with Windows Azure

• Dave Cliffe: Getting Nerdy with Workflow: Present and Future

• Brendon Birdoes: MythBusters: Is ASP.Net Web API the Best Way to Build RESTFul Services?

• Rick G. Garibay: A Lap Around WebSockets in the .NET 4.5 Developer Preview

• See calendar for upcoming meetings

• www.nwvdnug.org

• Twitter:@NWVDNUG

• Passion: We love what we do, and we do what we love. It‟s infectious. We go after each goal with uncontained energy and a clear-minded determination to achieve success.

• Discipline: We pursue excellence in everything we do. We demonstrate this through our commitment to consistency, accountability and quality.

• Innovation: We approach challenges from a unique perspective, which allows us to turn great ideas into game-changing products and solutions.

• Teaming: We trust each other, embrace conflict, honor commitments, hold ourselves accountable, and pay attention to results

• Integrity: We uphold the highest standard of ethics at all times, and conduct business the only way we know how, with honesty and transparency.

• Looking for passionate developers that are interested in furthering there career in a exciting environment

• Come on board to work with some of the most passionate individuals in the industry: Many of our top professionals have earned a variety of industry designations and certifications; several are designated Microsoft MVPs and Microsoft Virtual Technical Specialists

• Our Vision isTo be The Trusted Technology Partner in Business Innovation, guiding our customers along the shortest path to their business success

Upcoming Presentations Today

Rick Garibay

Chairman PCSUG

http://rickgaribay.net/

WebSockets Programming in .NET 4.5 and Windows Azure

Room: IRN-129

Time: 1:00pm - 2:00pm

Dan Weinmann and Nathan Smith

Aspect Oriented Programming - Removing code clutter with cross-cutting concerns

Room: IRN-207

Time: 2:15pm - 3:15pm

Michael Collins

http://www.michaelfcollins3.me/

Building Windows Azure applications with Node.js

Room: IRN-232

Time: 3:30pm - 4:30pm

Questions?


Recommended