SlideShare a Scribd company logo
Asynchronous Web
Programming with HTML5
WebSockets and Java
James Falkner
Community Manager, Liferay, Inc.
james.falkner@liferay.com
@schtool
The Asynchronous World
The Asynchronous Word
• Literally: Without Time
• Events that occur outside of the main program
execution flow
• Asynchronous != parallel/multi-threading
Execution Models

Recommended for you

IoT Security
IoT SecurityIoT Security
IoT Security

The growth of embedded systems connecting to the Internet or "Internet of Things" (IoT) increases year by year. Thus, the IoT ecosystems become new targets of the attackers. This presentation will talk about the basic principle of information security, why we need to secure IoT ecosystems, and also the vulnerabilities and solutions from OWASP.

iotinternet of thingsinformation security
Ppt 11 - netopeer
Ppt   11 - netopeerPpt   11 - netopeer
Ppt 11 - netopeer

NETOPEER is a set of open source NETCONF tools built on the libnetconf library. It includes a NETCONF server that runs on managed devices to allow configuration via NETCONF RPC operations and retrieve state data. It also includes a NETCONF agent that accepts incoming NETCONF connections and passes operations to the server, a CLI client to interact with the server, and a manager for YANG and transaction modules on the server. The presentation provides an overview of NETOPEER tools for managing devices using the NETCONF protocol.

Enhance network security with Multi-Factor Authentication for BYOD and guest ...
Enhance network security with Multi-Factor Authentication for BYOD and guest ...Enhance network security with Multi-Factor Authentication for BYOD and guest ...
Enhance network security with Multi-Factor Authentication for BYOD and guest ...

Enhance your network security by introducing Multi Factor Authentication (MFA) into new or existing use cases. New threats, risks, and vulnerabilities as well as evolving business requirements underscore to the need for a strong authentication approach based on simple service delivery, choice, and future-forward scalability. Learn how to create time, location and event driven policies to trigger new MFA workflows. Managed or unmanaged devices can be leveraged using secure MFA solutions from a variety of 3rd party providers and when combined with SSO, provides a much simpler and secure user experience versus traditional two-factor authentication methods..

aruba networks
Execution Models
Single-Threaded Synchronous Model
• Not much to say here
Execution Models
Threaded Model
• CPU controls interleaving
• Developer must
coordinate
threads/processes
• “preemptive multitasking”
Execution Models
Asynchronous Model
• Developer controls interleaving
• “cooperative multitasking”
• Wave goodbye to race conditions,
synchronized, and deadlocks!
• Windows 3.x, MacOS 9.x, Space
Shuttle
Execution Models
The green code (your code!)
runs uninterrupted until it
(you!) reaches a “good
stopping point”
(I/O)

Recommended for you

Authentication Protocols
Authentication ProtocolsAuthentication Protocols
Authentication Protocols

The document discusses authentication protocols and digital signatures. It describes mutual authentication protocols that allow two parties to verify each other's identities and exchange session keys. It also discusses one-way authentication protocols. The document focuses on explaining the Digital Signature Standard (DSS) and the Digital Signature Algorithm (DSA). It provides details on how DSA uses public/private key pairs to generate and verify digital signatures for authenticating messages and senders.

mutual authentication protocol.dsa operationsignature generation
Java compilation
Java compilationJava compilation
Java compilation

The document summarizes the process of compiling Java code from writing it in an IDE to running the bytecode on a JVM. It discusses how code is compiled incrementally in an IDE, generated into bytecode, dynamically loaded and interpreted with just-in-time compilation into native code for performance. It also overview's IBM's involvement in Java development and optimization.

Web authentication & authorization
Web authentication & authorizationWeb authentication & authorization
Web authentication & authorization

The document discusses web authentication and authorization. It introduces various authentication threats and technologies like usernames/passwords, one-time passwords, and Kerberos. It also discusses authentication attacks like brute force attacks and weak password recovery validation. The document then covers authentication techniques and infrastructures such as pluggable authentication modules and secure sockets layer. Finally, it discusses web authentication standards including single sign-on, OAuth, and OpenID.

cliwweb authenticationinfoiasi
What does this buy me?
NOTHING! Except when
• Task Pool is large
• Task I/O >> Task CPU
• Tasks mostly independent
… Like web servers
Asynchronous Web Programming with HTML5 WebSockets and Java
Programming Models
Threaded vs. Event-Driven
while (true) {
client = accept(80);
/* blocked! */
new Thread(new Handler(client)).start();
}
vs.
new Server(80, {
onConnect: {
handler.handle(client);
}
});
/* no blocking here, move along */

Recommended for you

OAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId ConnectOAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId Connect

This document discusses authentication and authorization frameworks like OAuth and OpenID Connect. It provides an overview of key concepts like authentication, authorization, roles in OAuth like resource owner, client, authorization server and resource server. It explains the authorization code grant flow in OAuth and how OpenID Connect builds upon OAuth to provide identity features. It also compares OpenID Connect to SAML and discusses Microsoft and TechCello implementations of these specifications.

authenticationidentityoauth
LoRaWAN Security Webinar
LoRaWAN Security WebinarLoRaWAN Security Webinar
LoRaWAN Security Webinar

The document discusses security in LoRaWAN networks. It describes how LoRaWAN uses cryptographic techniques like AES encryption with keys, and message authentication codes to provide security features like mutual authentication, integrity protection, and encryption. It explains the join procedure where devices are provisioned with session keys to communicate securely. Improvements in LoRaWAN 1.1 like additional replay protection and separation of security realms are also summarized. The document recommends best practices for provisioning devices securely and maintaining security across the entire IoT system.

lorawansecuritywebinar
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrong

JWTs provide a more secure and scalable alternative to cookie-based authentication. JWTs contain encrypted user information that is verified on the client-side and transmitted with each request, avoiding the need for database lookups on the server-side. In contrast, cookies require server-side sessions and database lookups to validate the user on each request. JWTs also enable cross-domain requests and work across mobile and web platforms, while cookies have limitations in these areas. Developers are advised to use a third-party service to handle JWT generation and verification rather than implementing it themselves.

jwtstatelesssaas
Threaded vs. Event-Driven
• Both can solve the exact same set of problems
• In fact, they are semantically equivalent
• Threaded costs in complexity and context
switching
• Event-Driven costs in complexity and no
context switching
Forces
• When to consider event-driven, asynchronous
programming models?
Async/Eventing Support
• Hardware/OS: Interrupts, select(), etc
• Languages: callbacks, closures, futures,
promises, Reactor/IOU pattern
• All accomplish the same thing: do this thing
for me, and when you’re done, do this other
dependent thing
• Frameworks
• Makes async/event programming possible or
easier
• JavaEE, Play, Vert.x, Cramp, node.js,
Twisted, …
Reducing Complexity
• Use established patterns
• Use established libraries and tooling
https://github.com/caolan/async

Recommended for you

Buffer overflow attacks
Buffer overflow attacksBuffer overflow attacks
Buffer overflow attacks

Stack-based and heap-based buffer overflow attacks, based on Counter Hack Reloaded (by Skoudis & Liston), & other sources.

network securitybuffer overflow attacks
Ppt 3 - IOT logic design
Ppt   3 - IOT logic designPpt   3 - IOT logic design
Ppt 3 - IOT logic design

The document discusses the logical design of IoT. It describes the key logical design elements including IoT functional blocks, communication models, and communication APIs. The logical design provides an abstract representation of IoT entities and processes without implementation details. The functional blocks provide capabilities for identification, sensing, actuation, communication and management. Common communication models are request-response, publish-subscribe, push-pull and exclusive pair. REST and WebSocket are examples of IoT communication APIs.

AWS for IoT
AWS for IoTAWS for IoT
AWS for IoT

This document provides an overview of AWS IoT services including key features and use cases. It discusses the AWS IoT message broker which supports standard protocols like MQTT to securely connect millions of devices. It also describes the rules engine which can transform messages and route them to other AWS services, thing shadows for persistent device states, and the device registry for identity management. Example use cases are given across various industries like healthcare, smart homes, manufacturing, and more.

aws-partner-summit
Typical Evented Web Apps
Event-Driven Java/JavaEE
• Java 1.0: Threads and AWT
• Java 1.4: NIO (Non-blocking I/O, nee New I/O)
• J2EE 1.2: JMS
• JavaEE 6: @Asynchronous and CDI
JavaEE 7: WebSockets
• Future: Lambda Expressions (closures)
myButton.addActionListener(ae -> {
System.out.println(ae.getSource());
});
Early Event-Driven Java
• Closure-like listeners (e.g. addActionListener(), handlers)
• Captured “free” variables must be final
• Hogging CPU in listener is bad
• References to this and OuterClass.this
Event-Driven JavaEE
• Servlet 3.0
• Async servlets
• JAX-RS (Jersey)
• Client Async API (via Futures/callbacks)
• Server Async HTTP Requests
• JMS
• Message Redelivery, QoS, scalability, …
• CDI/EJB
• Via @Inject, @Asynchronous and @Observes

Recommended for you

Cryptography ppt
Cryptography pptCryptography ppt
Cryptography ppt

The internet is the internationally connected network of computer networks with addresses that are administrated by IANA

cryptographyinternetiana
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMAC

This document discusses message authentication codes (MACs). It explains that MACs use a shared symmetric key to authenticate messages, ensuring integrity and validating the sender. The document outlines the MAC generation and verification process, and notes that MACs provide authentication but not encryption. It then describes HMAC specifically, which applies a cryptographic hash function to the message and key to generate the MAC. The key steps of the HMAC process are detailed.

message authentication codehmacmessage authentication code & hmac
Key management
Key managementKey management
Key management

Key management: Introduction, How public key distribution done, Diffie Hellman Key Exchage Algorithm,Digital Certificate. Key Management using Digital certificate is done etc. wireshark screenshot showing digital cetificate.

networkingmanagementinformation security
JavaEE Example: Event
Definition
public class HelloEvent {
private String msg;
public HelloEvent(String msg) {
msg = msg;
}
public String getMessage() {
return message;
}
}
JavaEE Example: Event
Subscriber
@Stateless
public class HelloListener {
@Asynchronous
public void listen(@Observes HelloEvent helloEvent){
System.out.println("HelloEvent: " + helloEvent);
}
}
JavaEE Example: Event Publish
@Named("messenger”)
@Stateless
public class HelloMessenger {
@Inject Event<HelloEvent> events;
public void hello() {
events.fire(new HelloEvent("from bean " +
System.currentTimeMillis()));
}
}
<h:commandButton
value="Fire!"
action="#{messenger.hello}"/>
JavaEE Example: Async Servlet

Recommended for you

Intro to AWS IoT
Intro to AWS IoTIntro to AWS IoT
Intro to AWS IoT

AWS IoT is a managed cloud platform that lets connected devices easily and securely interact with cloud applications and other devices.

awscloud computingaws-loft-london-2017
Tcp/ip server sockets
Tcp/ip server socketsTcp/ip server sockets
Tcp/ip server sockets

This document discusses sockets programming in Java. It covers server sockets, which listen for incoming client connections, and client sockets, which connect to servers. It describes how to create server and client sockets in Java using the ServerSocket and Socket classes. Examples are provided of simple Java programs to implement a TCP/IP server and client using sockets.

Building Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using WebsocketsBuilding Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using Websockets

This document discusses real-time web applications and the technologies needed to enable them. It describes how HTTP is half-duplex and led to hacks like long polling to simulate real-time behavior. The WebSocket protocol provides full-duplex communications by upgrading the HTTP handshake. This allows real-time messaging over a single connection. The document also covers asynchronous programming, event-driven architectures, and frameworks like Spring that support WebSockets and asynchronous APIs.

web design and developmentwebsocketjava
JavaEE Example: Async Servlet
Event-Driven Framework: Vert.x
Event-Driven JavaScript
• Not just for the browser
anymore
• It’s cool to like it! (again)
• Language features greatly
aid event-driven
programming
• Many, many frameworks to
aid in better design
The Asynchronous Web
• Goal: Responsive, Interactive sites
• Technique: Push or Pull
• First: Pull
• Request/Response
• AJAX Pull/Poll
• Now: Push
• Long Polling
• Proprietary (e.g. Flash)
• Server-Sent Events (nee HTTP Streaming)
• WebSockets

Recommended for you

Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with java

The document discusses various techniques for implementing real-time web applications, including polling, Comet, and WebSockets. It explains that polling involves the browser periodically requesting updates from the server. Comet enables long-polling to allow the server to push responses to the browser without requiring it to send frequent requests. WebSockets provide true two-way communication by upgrading the initial HTTP connection to a WebSocket protocol.

streamhubjavaservlet 3.0
Testing concurrent java programs - Sameer Arora
Testing concurrent java programs - Sameer AroraTesting concurrent java programs - Sameer Arora
Testing concurrent java programs - Sameer Arora

Session presented at the 6th IndicThreads.com Conference on Java held in Pune, India on 2-3 Dec. 2011. http://Java.IndicThreads.com

JUG louvain websockets
JUG louvain websocketsJUG louvain websockets
JUG louvain websockets

The document discusses the limitations of HTTP for building interactive real-time web applications and introduces WebSockets as an alternative. It explains that WebSockets allow for asynchronous, bidirectional communication over a single TCP connection, unlike HTTP which is stateless and half-duplex. The document also outlines the Java API for WebSockets (JSR 356) and provides examples of how WebSockets can be used for applications like chat, games, and social networking.

jug java websocket
Asynchronous Web Programming with HTML5 WebSockets and Java
WebSockets
• Bi-directional, full-duplex TCP connection
• Asynchronous APIs
• Related Standards
• Protocol: IETF RFC 6455
• Browser API: W3C WebSockets JavaScript
API
• Client/Server API: JSR-356 (Java)
• 50+ Implementations, 15+ Languages
• Java, C#, PHP, Python, C/C++, Node, …
Wire Protocol
Wire Protocol

Recommended for you

Servlet Async I/O Proposal (NIO.2)
Servlet Async I/O Proposal (NIO.2)Servlet Async I/O Proposal (NIO.2)
Servlet Async I/O Proposal (NIO.2)

This document introduces classes for asynchronous I/O in Servlet 3.0 without exposing low-level I/O details. New classes include ServletFuture, ServletAsyncHandler, ServletRequestChannel, and ServletResponseChannel. ServletRequestChannel allows asynchronous and synchronous read operations from the request body, while ServletResponseChannel allows write operations to the response. Examples demonstrate asynchronous and synchronous reads and writes, with the request automatically suspended for asynchronous operations.

servlet async i/o nio nio.2
Enhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocketEnhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocket

This presentation explains the basics of WebSockets and how a Developer can leverage its features to enhance a Mobile User Experience and offer real timing applications

websocket mobile user experience
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocket

Peter Lubbers from Kaazing gave a presentation on HTML5 WebSocket and communication technologies to the San Francisco Java User Group. He discussed the limitations of traditional HTTP for real-time applications and how technologies like polling and long polling add complexity. He then introduced HTML5 WebSocket as a new standard that enables true full-duplex communication with low latency. Finally, he briefly covered other HTML5 communication features like Server-Sent Events, XMLHttpRequest Level 2, and Cross Document Messaging.

Wire Protocol
• FIN
• Indicates the last frame of a message
• RSV[1-3]
• 0, or extension-specific
• OPCODE
• Frame identifier (continuation, text, close, etc)
• MASK
• Whether the frame is masked
• PAYLOAD LEN
• Length of data
• PAYLOAD DATA
• Extension Data + Application Data
WebSockets Options
• Endpoint identification
• Version negotiation
• Protocol Extensions negotiation
• Application Sub-protocol negotiation
• Security options
Handshake
Java Server API (JSR-356)
• Endpoints represent client/server connection
• Sessions model set of interactions over
Endpoint
• sync/async messages
• Injection
• Custom encoding/decoding
• Configuration options mirror wire protocol
• Binary/Text
• PathParam
• Extensions

Recommended for you

Think async
Think asyncThink async
Think async

With the growing challenges we face with shortage of resources there is a constant need to improve scalability and performance. Fortunately Java EE 7 and Java SE 7 has provided a rich set of APIs which can be used to avoid the conventional request-response paradigm. The session will span across JSRs cover how JAX-RS, Servlets, WebSockets, EJB provide support to submit asynchronous requests and cover topics like callbacks, timeouts, client side asynchrony, API like non blocking IO and lots of good stuff from Java EE 7 and Java SE 7 . Prerequisite: An open mind and be ready to “Think async”

Quize on scripting shell
Quize on scripting shellQuize on scripting shell
Quize on scripting shell

This document contains questions and answers related to Linux/Unix shells. Some key points: - It asks about common shell commands like date, who, pwd, rm, grep, ps, kill, mail, etc. and how to use them. - It covers shell scripting concepts like variables ($VAR), conditionals (if/else), loops (for, while), I/O redirection, functions, and more. - Questions address shells basics like finding the shell, users, processes, directories and files as well as more advanced topics like process IDs, background processes, command line arguments, and Boolean/conditional operators.

Shell Scripting With Arguments
Shell Scripting With ArgumentsShell Scripting With Arguments
Shell Scripting With Arguments

The document describes four shell scripts - twice, home, suffix, and rnfile. It provides preliminary results for twice, home, and suffix. Twice doubles an integer argument but produces errors if no argument is given or the argument is non-integer. Home prints a user's home directory given their name as an argument, but produces an error if no argument is provided. Suffix renames a file by adding a suffix argument to the filename.

shell scriptingalextechnical document
Java Server API
@ServerEndpoint("/websocket")
public class MyEndpoint {
private Session session;
@OnOpen
public void open(Session session) {
this.session = session;
}
@OnMessage
public String echoText(String msg) {
return msg;
}
@OnClose
…
@OnError
…
public void sendSomething() {
session.getAsyncRemote()
.sendText(“Boo!”);
}
Client API (JavaScript)
var ws = new WebSocket('ws://host:port/endpoint');
ws.onmessage = function (event) {
console.log('Received text from the server: ' + event.data);
// do something with it
};
ws.onerror = function(event) {
console. log("Uh oh");
};
ws.onopen = function(event) {
// Here we know connection is established,
// so enable the UI to start sending!
};
ws.onclose = function(event) {
// Here the connection is closing (e.g. user is leaving page),
// so stop sending stuff.
};
Client API (Other)
• Non-Browser APIs for C/C++, Java, .NET, Perl,
PHP, Python, C#, and probably others
WebSocket webSocketClient =
new WebSocket("ws://127.0.0.1:911/websocket", "basic");
webSocketClient.OnClose += new EventHandler(webSocketClient_OnClose);
webSocketClient.OnMessage += new
EventHandler<MessageEventArgs>(webSocketClient_OnMessage);
webSocketClient.Connect());
webSocketClient.Send(“HELLO THERE SERVER!”);
webSocketClient.Close();
Browser Support
• Your users don’t care about WebSockets
• Fallback support: jQuery, Vaadin, Atmosphere,
Socket.IO, Play, etc

Recommended for you

Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...

This is part 5 of the training "introduction to linux for bioinformatics". Here we introduce more advanced use on the command line (piping, redirecting) and provide you a selection of GNU text mining and analysis tools that assist you tremendously in handling your bioinformatics data. Interested in following this training session? Contact me at http://www.jakonix.be/contact.html

wcshellsort
Cloud Foundry Summit 2015: Cloud Foundry and IoT Protocol Support
Cloud Foundry Summit 2015: Cloud Foundry and IoT Protocol SupportCloud Foundry Summit 2015: Cloud Foundry and IoT Protocol Support
Cloud Foundry Summit 2015: Cloud Foundry and IoT Protocol Support

Speaker: Atul Kshir­sagar, GE Soft­ware To learn more about Pivotal Cloud Foundry, visit http://www.pivotal.io/platform-as-a-service/pivotal-cloud-foundry.

cloud foundry summitcfsummit
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets

Overview of WebSockets (protocol and Java EE7 support) by Erin Schnabel (Liberty Profile Development Lead, IBM | @ebullientworks)

java ee 7webspherejava ee
Asynchronous Web Programming with HTML5 WebSockets and Java
Demo
WebSocket
ServerEndpoint
JVM
HTTP
WS
Demo Part Deux
WebSocket
ServerEndpoint
JVM
Node
HTTP
HTTP
WS
WebSocket Gotchas
• Using WebSockets in a thread-based system
(e.g. the JVM)
• Sending or receiving data before connection is
established, re-establishing connections
• UTF-8 Encoding
• Extensions, security, masking make debugging
more challenging

Recommended for you

Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting

This document provides an overview of Linux Bash shell scripting. It covers topics such as writing basic scripts, variables, conditionals, loops, functions, arguments, and input/output redirection. Examples are given for many common scripting tasks like arithmetic operations, string manipulation, file operations, and comparing values. The document is intended to teach the basics of scripting in the Linux Bash shell.

control statementsregular expressionssyntax
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure

Slide deck from my talk on Node.js. More information is available here: http://colinmackay.scot/2014/11/29/dunddd-2014-introduction-to-node-jsfrom-hello-world-to-deploying-on-azure/

azureexpressnode.js
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting

This document provides an introduction and overview of shell scripting in Linux. It discusses what a shell script is, when they should and should not be used, examples of common shell scripts, and an introduction to programming features commonly used in shell scripts such as variables, conditionals, loops, command line arguments, and more. Key points covered include that shell scripts allow automating command execution, are useful for repetitive tasks, and come with programming features to customize behavior.

WebSocket Issues
• Ephemeral Port Exhaustion
• Evolving interfaces
• Misbehaving Proxies
Acknowledgements
http://cs.brown.edu/courses/cs168/f12/handouts/async.pdf (Execution Models)
http://www.infosecisland.com/blogview/12681-The-WebSocket-Protocol-Past-Travails-To-Be-Avoided.html (problems)
http://lucumr.pocoo.org/2012/9/24/websockets-101/ (more problems)
http://wmarkito.wordpress.com/2012/07/20/cdi-events-synchronous-x-asynchronous/ (cdi examples)
http://blog.arungupta.me/2010/05/totd-139-asynchronous-request-processing-using-servlets-3-0-and-java-ee-6/ (async
servlets)
http://vertx.io (vert.x example)
https://cwiki.apache.org/TUSCANYWIKI/develop-websocket-binding-for-apache-tuscany.html (handshake image)
http://caniuse.com/websockets (browser compat graph)
Asynchronous Web
Programming with HTML5
WebSockets and Java
James Falkner
Community Manager, Liferay, Inc.
james.falkner@liferay.com
@schtool

More Related Content

What's hot

Introduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring SecurityIntroduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring Security
Bruno Henrique Rother
 
Python for IoT
Python for IoTPython for IoT
Python for IoT
Selvaraj Seerangan
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
Intelligo Technologies
 
IoT Security
IoT SecurityIoT Security
Ppt 11 - netopeer
Ppt   11 - netopeerPpt   11 - netopeer
Ppt 11 - netopeer
udhayakumarc1
 
Enhance network security with Multi-Factor Authentication for BYOD and guest ...
Enhance network security with Multi-Factor Authentication for BYOD and guest ...Enhance network security with Multi-Factor Authentication for BYOD and guest ...
Enhance network security with Multi-Factor Authentication for BYOD and guest ...
Aruba, a Hewlett Packard Enterprise company
 
Authentication Protocols
Authentication ProtocolsAuthentication Protocols
Authentication Protocols
Trinity Dwarka
 
Java compilation
Java compilationJava compilation
Java compilation
Mike Kucera
 
Web authentication & authorization
Web authentication & authorizationWeb authentication & authorization
Web authentication & authorization
Alexandru Pasaila
 
OAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId ConnectOAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId Connect
Saran Doraiswamy
 
LoRaWAN Security Webinar
LoRaWAN Security WebinarLoRaWAN Security Webinar
LoRaWAN Security Webinar
Actility
 
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrong
Derek Perkins
 
Buffer overflow attacks
Buffer overflow attacksBuffer overflow attacks
Buffer overflow attacks
Joe McCarthy
 
Ppt 3 - IOT logic design
Ppt   3 - IOT logic designPpt   3 - IOT logic design
Ppt 3 - IOT logic design
udhayakumarc1
 
AWS for IoT
AWS for IoTAWS for IoT
AWS for IoT
Amazon Web Services
 
Cryptography ppt
Cryptography pptCryptography ppt
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMAC
Krishna Gehlot
 
Key management
Key managementKey management
Key management
Sujata Regoti
 
Intro to AWS IoT
Intro to AWS IoTIntro to AWS IoT
Intro to AWS IoT
Amazon Web Services
 
Tcp/ip server sockets
Tcp/ip server socketsTcp/ip server sockets
Tcp/ip server sockets
rajshreemuthiah
 

What's hot (20)

Introduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring SecurityIntroduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring Security
 
Python for IoT
Python for IoTPython for IoT
Python for IoT
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 
IoT Security
IoT SecurityIoT Security
IoT Security
 
Ppt 11 - netopeer
Ppt   11 - netopeerPpt   11 - netopeer
Ppt 11 - netopeer
 
Enhance network security with Multi-Factor Authentication for BYOD and guest ...
Enhance network security with Multi-Factor Authentication for BYOD and guest ...Enhance network security with Multi-Factor Authentication for BYOD and guest ...
Enhance network security with Multi-Factor Authentication for BYOD and guest ...
 
Authentication Protocols
Authentication ProtocolsAuthentication Protocols
Authentication Protocols
 
Java compilation
Java compilationJava compilation
Java compilation
 
Web authentication & authorization
Web authentication & authorizationWeb authentication & authorization
Web authentication & authorization
 
OAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId ConnectOAuth 2.0 and OpenId Connect
OAuth 2.0 and OpenId Connect
 
LoRaWAN Security Webinar
LoRaWAN Security WebinarLoRaWAN Security Webinar
LoRaWAN Security Webinar
 
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrong
 
Buffer overflow attacks
Buffer overflow attacksBuffer overflow attacks
Buffer overflow attacks
 
Ppt 3 - IOT logic design
Ppt   3 - IOT logic designPpt   3 - IOT logic design
Ppt 3 - IOT logic design
 
AWS for IoT
AWS for IoTAWS for IoT
AWS for IoT
 
Cryptography ppt
Cryptography pptCryptography ppt
Cryptography ppt
 
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMAC
 
Key management
Key managementKey management
Key management
 
Intro to AWS IoT
Intro to AWS IoTIntro to AWS IoT
Intro to AWS IoT
 
Tcp/ip server sockets
Tcp/ip server socketsTcp/ip server sockets
Tcp/ip server sockets
 

Viewers also liked

Building Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using WebsocketsBuilding Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using Websockets
Naresh Chintalcheru
 
Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with java
JeongHun Byeon
 
Testing concurrent java programs - Sameer Arora
Testing concurrent java programs - Sameer AroraTesting concurrent java programs - Sameer Arora
Testing concurrent java programs - Sameer Arora
IndicThreads
 
JUG louvain websockets
JUG louvain websocketsJUG louvain websockets
JUG louvain websockets
Marc Tritschler
 
Servlet Async I/O Proposal (NIO.2)
Servlet Async I/O Proposal (NIO.2)Servlet Async I/O Proposal (NIO.2)
Servlet Async I/O Proposal (NIO.2)
jfarcand
 
Enhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocketEnhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocket
Mauricio "Maltron" Leal
 
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocket
brent bucci
 
Think async
Think asyncThink async
Think async
Bhakti Mehta
 
Quize on scripting shell
Quize on scripting shellQuize on scripting shell
Quize on scripting shell
lebse123
 
Shell Scripting With Arguments
Shell Scripting With ArgumentsShell Scripting With Arguments
Shell Scripting With Arguments
Alex Shaw III
 
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Joachim Jacob
 
Cloud Foundry Summit 2015: Cloud Foundry and IoT Protocol Support
Cloud Foundry Summit 2015: Cloud Foundry and IoT Protocol SupportCloud Foundry Summit 2015: Cloud Foundry and IoT Protocol Support
Cloud Foundry Summit 2015: Cloud Foundry and IoT Protocol Support
VMware Tanzu
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
WASdev Community
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
Raghu nath
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
Colin Mackay
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
Gaurav Shinde
 
Bash shell
Bash shellBash shell
Bash shell
xylas121
 
From Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSocketsFrom Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSockets
Alessandro Alinone
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
Dr.Ravi
 
Serverless Data Architecture at scale on Google Cloud Platform - Lorenzo Ridi...
Serverless Data Architecture at scale on Google Cloud Platform - Lorenzo Ridi...Serverless Data Architecture at scale on Google Cloud Platform - Lorenzo Ridi...
Serverless Data Architecture at scale on Google Cloud Platform - Lorenzo Ridi...
Codemotion
 

Viewers also liked (20)

Building Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using WebsocketsBuilding Next Generation Real-Time Web Applications using Websockets
Building Next Generation Real-Time Web Applications using Websockets
 
Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with java
 
Testing concurrent java programs - Sameer Arora
Testing concurrent java programs - Sameer AroraTesting concurrent java programs - Sameer Arora
Testing concurrent java programs - Sameer Arora
 
JUG louvain websockets
JUG louvain websocketsJUG louvain websockets
JUG louvain websockets
 
Servlet Async I/O Proposal (NIO.2)
Servlet Async I/O Proposal (NIO.2)Servlet Async I/O Proposal (NIO.2)
Servlet Async I/O Proposal (NIO.2)
 
Enhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocketEnhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocket
 
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocket
 
Think async
Think asyncThink async
Think async
 
Quize on scripting shell
Quize on scripting shellQuize on scripting shell
Quize on scripting shell
 
Shell Scripting With Arguments
Shell Scripting With ArgumentsShell Scripting With Arguments
Shell Scripting With Arguments
 
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
 
Cloud Foundry Summit 2015: Cloud Foundry and IoT Protocol Support
Cloud Foundry Summit 2015: Cloud Foundry and IoT Protocol SupportCloud Foundry Summit 2015: Cloud Foundry and IoT Protocol Support
Cloud Foundry Summit 2015: Cloud Foundry and IoT Protocol Support
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
Bash shell
Bash shellBash shell
Bash shell
 
From Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSocketsFrom Push Technology to Real-Time Messaging and WebSockets
From Push Technology to Real-Time Messaging and WebSockets
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Serverless Data Architecture at scale on Google Cloud Platform - Lorenzo Ridi...
Serverless Data Architecture at scale on Google Cloud Platform - Lorenzo Ridi...Serverless Data Architecture at scale on Google Cloud Platform - Lorenzo Ridi...
Serverless Data Architecture at scale on Google Cloud Platform - Lorenzo Ridi...
 

Similar to Asynchronous Web Programming with HTML5 WebSockets and Java

soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
soft-shake.ch
 
Node.js: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The When
FITC
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
Stuart (Pid) Williams
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Richard Lee
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
GWTcon
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
orkaplan
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
Gonzalo Ayuso
 
MeteorJS Introduction
MeteorJS IntroductionMeteorJS Introduction
MeteorJS Introduction
Nitya Narasimhan
 
Scalable io in java
Scalable io in javaScalable io in java
Scalable io in java
Giridhar Addepalli
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and Scala
Yevgeniy Brikman
 
Windows 8 Apps and the Outside World
Windows 8 Apps and the Outside WorldWindows 8 Apps and the Outside World
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileIVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
Amazon Web Services Japan
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1
Mohammad Qureshi
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
Sam Brannen
 
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShiftReal world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Christian Posta
 
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShiftReal-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
Christian Posta
 
JUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talkJUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talk
Vijay Nair
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.x
Yiguang Hu
 
What’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyWhat’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new Strategy
Mohamed Taman
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
Tom Croucher
 

Similar to Asynchronous Web Programming with HTML5 WebSockets and Java (20)

soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
Node.js: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The When
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
MeteorJS Introduction
MeteorJS IntroductionMeteorJS Introduction
MeteorJS Introduction
 
Scalable io in java
Scalable io in javaScalable io in java
Scalable io in java
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and Scala
 
Windows 8 Apps and the Outside World
Windows 8 Apps and the Outside WorldWindows 8 Apps and the Outside World
Windows 8 Apps and the Outside World
 
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileIVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShiftReal world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShift
 
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShiftReal-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
 
JUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talkJUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talk
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.x
 
What’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyWhat’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new Strategy
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 

Recently uploaded

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
Stephanie Beckett
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
Larry Smarr
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 

Recently uploaded (20)

How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 

Asynchronous Web Programming with HTML5 WebSockets and Java

  • 1. Asynchronous Web Programming with HTML5 WebSockets and Java James Falkner Community Manager, Liferay, Inc. james.falkner@liferay.com @schtool
  • 3. The Asynchronous Word • Literally: Without Time • Events that occur outside of the main program execution flow • Asynchronous != parallel/multi-threading
  • 5. Execution Models Single-Threaded Synchronous Model • Not much to say here
  • 6. Execution Models Threaded Model • CPU controls interleaving • Developer must coordinate threads/processes • “preemptive multitasking”
  • 7. Execution Models Asynchronous Model • Developer controls interleaving • “cooperative multitasking” • Wave goodbye to race conditions, synchronized, and deadlocks! • Windows 3.x, MacOS 9.x, Space Shuttle
  • 8. Execution Models The green code (your code!) runs uninterrupted until it (you!) reaches a “good stopping point” (I/O)
  • 9. What does this buy me? NOTHING! Except when • Task Pool is large • Task I/O >> Task CPU • Tasks mostly independent … Like web servers
  • 12. Threaded vs. Event-Driven while (true) { client = accept(80); /* blocked! */ new Thread(new Handler(client)).start(); } vs. new Server(80, { onConnect: { handler.handle(client); } }); /* no blocking here, move along */
  • 13. Threaded vs. Event-Driven • Both can solve the exact same set of problems • In fact, they are semantically equivalent • Threaded costs in complexity and context switching • Event-Driven costs in complexity and no context switching
  • 14. Forces • When to consider event-driven, asynchronous programming models?
  • 15. Async/Eventing Support • Hardware/OS: Interrupts, select(), etc • Languages: callbacks, closures, futures, promises, Reactor/IOU pattern • All accomplish the same thing: do this thing for me, and when you’re done, do this other dependent thing • Frameworks • Makes async/event programming possible or easier • JavaEE, Play, Vert.x, Cramp, node.js, Twisted, …
  • 16. Reducing Complexity • Use established patterns • Use established libraries and tooling https://github.com/caolan/async
  • 18. Event-Driven Java/JavaEE • Java 1.0: Threads and AWT • Java 1.4: NIO (Non-blocking I/O, nee New I/O) • J2EE 1.2: JMS • JavaEE 6: @Asynchronous and CDI JavaEE 7: WebSockets • Future: Lambda Expressions (closures) myButton.addActionListener(ae -> { System.out.println(ae.getSource()); });
  • 19. Early Event-Driven Java • Closure-like listeners (e.g. addActionListener(), handlers) • Captured “free” variables must be final • Hogging CPU in listener is bad • References to this and OuterClass.this
  • 20. Event-Driven JavaEE • Servlet 3.0 • Async servlets • JAX-RS (Jersey) • Client Async API (via Futures/callbacks) • Server Async HTTP Requests • JMS • Message Redelivery, QoS, scalability, … • CDI/EJB • Via @Inject, @Asynchronous and @Observes
  • 21. JavaEE Example: Event Definition public class HelloEvent { private String msg; public HelloEvent(String msg) { msg = msg; } public String getMessage() { return message; } }
  • 22. JavaEE Example: Event Subscriber @Stateless public class HelloListener { @Asynchronous public void listen(@Observes HelloEvent helloEvent){ System.out.println("HelloEvent: " + helloEvent); } }
  • 23. JavaEE Example: Event Publish @Named("messenger”) @Stateless public class HelloMessenger { @Inject Event<HelloEvent> events; public void hello() { events.fire(new HelloEvent("from bean " + System.currentTimeMillis())); } } <h:commandButton value="Fire!" action="#{messenger.hello}"/>
  • 27. Event-Driven JavaScript • Not just for the browser anymore • It’s cool to like it! (again) • Language features greatly aid event-driven programming • Many, many frameworks to aid in better design
  • 28. The Asynchronous Web • Goal: Responsive, Interactive sites • Technique: Push or Pull • First: Pull • Request/Response • AJAX Pull/Poll • Now: Push • Long Polling • Proprietary (e.g. Flash) • Server-Sent Events (nee HTTP Streaming) • WebSockets
  • 30. WebSockets • Bi-directional, full-duplex TCP connection • Asynchronous APIs • Related Standards • Protocol: IETF RFC 6455 • Browser API: W3C WebSockets JavaScript API • Client/Server API: JSR-356 (Java) • 50+ Implementations, 15+ Languages • Java, C#, PHP, Python, C/C++, Node, …
  • 33. Wire Protocol • FIN • Indicates the last frame of a message • RSV[1-3] • 0, or extension-specific • OPCODE • Frame identifier (continuation, text, close, etc) • MASK • Whether the frame is masked • PAYLOAD LEN • Length of data • PAYLOAD DATA • Extension Data + Application Data
  • 34. WebSockets Options • Endpoint identification • Version negotiation • Protocol Extensions negotiation • Application Sub-protocol negotiation • Security options
  • 36. Java Server API (JSR-356) • Endpoints represent client/server connection • Sessions model set of interactions over Endpoint • sync/async messages • Injection • Custom encoding/decoding • Configuration options mirror wire protocol • Binary/Text • PathParam • Extensions
  • 37. Java Server API @ServerEndpoint("/websocket") public class MyEndpoint { private Session session; @OnOpen public void open(Session session) { this.session = session; } @OnMessage public String echoText(String msg) { return msg; } @OnClose … @OnError … public void sendSomething() { session.getAsyncRemote() .sendText(“Boo!”); }
  • 38. Client API (JavaScript) var ws = new WebSocket('ws://host:port/endpoint'); ws.onmessage = function (event) { console.log('Received text from the server: ' + event.data); // do something with it }; ws.onerror = function(event) { console. log("Uh oh"); }; ws.onopen = function(event) { // Here we know connection is established, // so enable the UI to start sending! }; ws.onclose = function(event) { // Here the connection is closing (e.g. user is leaving page), // so stop sending stuff. };
  • 39. Client API (Other) • Non-Browser APIs for C/C++, Java, .NET, Perl, PHP, Python, C#, and probably others WebSocket webSocketClient = new WebSocket("ws://127.0.0.1:911/websocket", "basic"); webSocketClient.OnClose += new EventHandler(webSocketClient_OnClose); webSocketClient.OnMessage += new EventHandler<MessageEventArgs>(webSocketClient_OnMessage); webSocketClient.Connect()); webSocketClient.Send(“HELLO THERE SERVER!”); webSocketClient.Close();
  • 40. Browser Support • Your users don’t care about WebSockets • Fallback support: jQuery, Vaadin, Atmosphere, Socket.IO, Play, etc
  • 44. WebSocket Gotchas • Using WebSockets in a thread-based system (e.g. the JVM) • Sending or receiving data before connection is established, re-establishing connections • UTF-8 Encoding • Extensions, security, masking make debugging more challenging
  • 45. WebSocket Issues • Ephemeral Port Exhaustion • Evolving interfaces • Misbehaving Proxies
  • 46. Acknowledgements http://cs.brown.edu/courses/cs168/f12/handouts/async.pdf (Execution Models) http://www.infosecisland.com/blogview/12681-The-WebSocket-Protocol-Past-Travails-To-Be-Avoided.html (problems) http://lucumr.pocoo.org/2012/9/24/websockets-101/ (more problems) http://wmarkito.wordpress.com/2012/07/20/cdi-events-synchronous-x-asynchronous/ (cdi examples) http://blog.arungupta.me/2010/05/totd-139-asynchronous-request-processing-using-servlets-3-0-and-java-ee-6/ (async servlets) http://vertx.io (vert.x example) https://cwiki.apache.org/TUSCANYWIKI/develop-websocket-binding-for-apache-tuscany.html (handshake image) http://caniuse.com/websockets (browser compat graph)
  • 47. Asynchronous Web Programming with HTML5 WebSockets and Java James Falkner Community Manager, Liferay, Inc. james.falkner@liferay.com @schtool