The HTML5 WebSocket API allows for true full-duplex communication between a client and server. It uses the WebSocket protocol which provides a standardized way for the client to "upgrade" an HTTP connection to a WebSocket connection, allowing for messages to be sent in either direction at any time with very little overhead. This enables real-time applications that were previously difficult to achieve with traditional HTTP requests. Common server implementations include Kaazing WebSocket Gateway, Jetty, and Node.js. The JavaScript API provides an easy way for clients to connect, send, and receive messages via a WebSocket connection.
Asynchronous Web Programming with HTML5 WebSockets and Java
(Talk originally given @ KCDC - http://kcdc.info ).
Over the last decade, advances in web computing have removed many of the barriers to entry for developers. New languages, frameworks, and development methodologies have kickstarted new ideas and new ways to develop web applications to make modern life easier and more efficient. WebSockets (introduced as part of HTML5) is one such technology that enables a new class of scalable, super-responsive, collaborative, and real-time web applications with a wide range of uses.
In this talk, we will first cover the basics of asynchronous web programming using WebSockets, including predecessors such as polling and long-polling, applications of WebSockets, its limitations and potential bottlenecks, and potential future improvements.
Next, we will demo and dissect a real-world use case for realtime social data analytics, using the Apache Tomcat implementation of WebSockets and the Java-based Liferay Portal Server. This will include a discussion about development of WebSocket endpoints, its lifecycle within the application container and browser, debugging WebSockets, and scalability topics.
This document discusses WebSockets and Spring WebSockets. It begins by introducing WebSockets as a protocol for real-time full duplex communication over a single TCP connection. It then covers the WebSocket handshake process and JavaScript WebSocket API. Next, it discusses Java WebSocket implementations and how Spring 4 supports WebSockets and the fallback SockJS protocol. Finally, it introduces STOMP as a simple messaging protocol that can be used over WebSockets, and how Spring supports asynchronous messaging using STOMP over WebSockets.
The document discusses WebSockets as a new technology for real-time communication on the web. It presents jWebSocket, an open source framework that supports WebSockets and allows for bidirectional communication between web applications and servers. The framework offers features like messaging, streaming, security and supports multiple platforms and browsers. WebSockets enable use cases like chats, remote monitoring and collaboration that were previously difficult to implement on the web.
WebSockets allow for bidirectional communication between a client and server over a single TCP connection. They improve on older "Comet" techniques which used polling and long-polling to simulate real-time updates. With WebSockets, the client can open a WebSocket connection to the server which sends messages at any time without needing an explicit request. This enables real-time applications with constantly updating information. The document outlines the WebSocket protocol, provides examples of the API in browsers, and discusses frameworks for building WebSocket applications.
The document discusses WebSocket in Java, including:
1. WebSocket is a protocol providing full-duplex communications over a single TCP connection and was standardized by IETF as RFC 6455.
2. Sample WebSocket applications are demonstrated using the JavaWebSocket library, Java EE 7 with Tomcat, and Spring 4 with SockJS for fallback support to older browsers.
3. Code snippets show how to set up WebSocket servers and handlers in each approach to handle connections, messages, and disconnections from clients.
This document discusses using WebSockets for bidirectional communication between a GWT client and server. It provides an overview of setting up WebSocket connections on both the client and server sides in GWT, including writing a JSNI wrapper to initialize the WebSocket on the client. It also discusses using GWT's existing RPC serialization mechanism to serialize and deserialize Java objects sent over the WebSocket connection, avoiding the need for additional serialization libraries. Code examples are provided for initializing the WebSocket and handling messages on both the client and server sides, as well as using GWT's serialization streams to serialize and deserialize objects between the client and server.
Getting Started with WebSocket and Server-Sent Events in Java
This document discusses WebSocket and Server-Sent Events (SSE) in Java. It provides an overview of WebSocket including the handshake process and lifecycle. It also covers the Java API for creating WebSocket endpoints and handling messages. The document then discusses SSE and the EventSource JavaScript API. Finally, it compares WebSocket and SSE, noting their differences in capabilities and use cases.
This document discusses the purpose, background, and implementation status of web sockets. It describes how web sockets enable bidirectional communication between web applications and servers through a single TCP connection. This overcomes limitations of traditional HTTP where communication was typically one-way from server to client using polling. The document outlines the web socket protocol specification process involving the W3C and IETF and lists some potential application areas.
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
WebSockets provide a standardized way for web browsers and servers to establish two-way communications channels over a single TCP connection. They allow for more efficient real-time messaging compared to older techniques like polling and long-polling. The WebSocket API defines client-side and server-side interfaces that allow for full-duplex communications that some popular Java application servers and web servers support natively. Common use cases that benefit from WebSockets include chat applications, online games, and real-time updating of social streams.
HTML5 WebSocket for the Real-Time Weband the Internet of Things
Abstract: In his talk Peter gives a brief introduction to WebSocket and discusses how real-time Web communications technologies can be applied to an always connected Web and mobile world. Then, he walks you through how to provide interactivity and collaboration by controlling physical objects remotely. The presentation features several live demonstrations of the concepts discussed throughout the session.
This document provides an overview of Jerromy Lee and his work developing interactive media applications and games using technologies like WebSockets, Bluetooth, and peer-to-peer networking. It summarizes Jerromy's background and experience, describes several projects he has worked on including games for McDonald's and Sony, and provides information on the tools and techniques used to develop these types of connected experiences, including JavaScript, EaselJS, Node.js, and Socket.io.
Websockets in Node.js - Making them reliable and scalable
This document discusses implementing websockets in Node.js. It covers popular websocket libraries like Socket.io and Engine.io, considerations for reliability and scalability, and using Redis for pub/sub to allow messages to be passed between servers and achieve scalable websockets. Code examples are provided for setting up websockets on both the client and server sides using Engine.io and Redis.
The document discusses the history and development of WebSockets. It describes how earlier protocols like HTTP, AJAX, and polling had limitations for real-time full-duplex communication needs. WebSockets were created as a new protocol to allow persistent connections and transmission of data between a client and server with low overhead. The document outlines the WebSocket handshake process and API, discusses security considerations, and provides examples of how WebSockets have been used in online games, visualization tools, and other real-time applications.
Simon Willison gave a presentation on Comet, a technique for enabling live data updates in web applications. Comet allows a web server to push events to connected browsers in real-time. It has faced many technical challenges due to browser limitations. Key techniques discussed include streaming, long polling, and the Bayeaux protocol which provides a common way for Comet clients and servers to communicate. The presentation showed how to easily build a basic Comet application using Jetty and Dojo in just a few lines of code.
Presented at the Yahoo! Web Development Summit in December 2007. Comet is the new name for the old trick of streaming events down to the browser from the server. This talk introduces Comet and shows how, despite the terrifying browser tricks needed, it's actually now very simple to build against.
Getting Started with WebSockets and Server-Sent Events
This document discusses WebSocket and Server-Sent Events (SSE) for building interactive web applications. It provides an overview of WebSocket including how it enables full-duplex communication over a single TCP connection and the handshake process. It also discusses the Java API for WebSocket including annotated endpoints and custom payloads. Finally, it covers SSE, the EventSource API, and an example SSE implementation in Java.
Node.js is an asynchronous event-driven JavaScript runtime that allows JavaScript to be used on the server-side. It uses a non-blocking I/O model that makes it suitable for real-time web applications. WebSockets provide a standardized way for the browser and server to establish two-way communication. However, not all browsers support WebSockets yet. Socket.io addresses this by providing a WebSocket-like experience across all browsers through fallbacks like long-polling. It allows real-time applications to be developed more easily.
This document summarizes a hackathon event where a team worked on developing an iSlide presentation platform. They explored using websockets to enable real-time sharing and editing of slides. They also discussed dynamically generating QR codes and accessing the local network IP address from within Android applications to access the iSlide server.
WebSocket is a protocol that provides full-duplex communication channels over a single TCP connection. It was standardized in 2011 and allows for real-time data exchange between a client and server. The document discusses how WebSocket works, compares it to previous techniques like polling which had limitations, and outlines how to implement WebSocket in Java using JSR 356 and in Spring using the WebSocket API and STOMP protocol.
The document discusses pushing data from a server to a browser using Comet techniques like long polling and streaming. It describes how Comet allows for real-time updates without polling by keeping connections open. The Bayeux protocol is presented as an open standard for implementing Comet with publish/subscribe messaging on both the client-side and server-side in Java. Examples of using Comet for chat applications and sensor data updates are provided.
The document discusses Websockets and compares them to HTTP. It provides an overview of Websockets including how they work, specifications, and examples of using Websockets in JavaScript, Android Java, and Java server-side code with the jquery-websocket library. Benefits highlighted include full-duplex communication, lower overhead than HTTP, and lower latency.
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.
This 15 minute presentation discusses non-blocking I/O, event loops, and Node.js. It builds on previous work by Ryan Dahl, explaining how threads can be expensive due to context switching and memory usage, and how Node.js uses an event-driven, non-blocking model to avoid these costs. Code examples demonstrate getting and printing a policy object, handling HTTP requests asynchronously without blocking additional connections, and using callbacks to chain asynchronous actions together.
Text Editors (Atom / Sublime)
Apache Server (sftp/ssh/php) – Todd's Server!
CPanel / Wordpress (server side details)
Working with any Web API (Mapping Example)
(facebook, linkedin, twitter, maps, d3.js, jquary)
JSON and HTML <img>
GIT http://www.github.com
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets couples the performance and flexibility of TCP with the reach of HTTP Prediction: WebSockets will replace simple TCP as preferred underlying protocol.
To see how Websockets are used in a popular HTML5-based remote access solution, by visiting the following URL: http://j.mp/1luquBQ
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.
The document discusses using Gevent and Socket.io for building real-time web applications, providing code examples for building a chat application that uses Gevent for asynchronous programming, Socket.io for client-server communication, and ZeroMQ for inter-process communication between greenlets. It describes the design and implementation of a web-based chat application that allows clients to send and receive messages in real-time using these technologies.
This document discusses techniques for analyzing the performance of mobile web applications. It covers challenges like network variability, different device hardware, and continuous integration. Approaches mentioned include benchmarking, injecting instrumentation, emulation, and remote inspection. Strategies suggested are reducing complexity, replicating analysis on desktop, and tweaking at the system level. Tools mentioned include the Nexus One, Gingerbread, PhantomJS, and headless WebKit. The document provides examples and caveats for analyzing areas like network traffic, graphics commands, garbage collection, and JavaScript parsing.
1. The document discusses a meetup about WebSocket and SPDY protocols on July 5th, 2012 presented by Kensaku Komatsu.
2. The presentation covered introductions to WebSocket and SPDY, how they address issues with HTTP such as slow loading of multiple resources, and compared their communication models and transport protocols.
3. The main topics were introductions to WebSocket and SPDY, and a deeper dive into the WebSocket protocol including its handshake process, data framing, ping/pong functionality, and additional aspects like subprotocols and extensions.
The document discusses WebSocket technology. It provides an overview of WebSocket, including how it works, how it differs from HTTP by being bidirectional and using a single TCP connection, and how the handshake process upgrades an HTTP connection to WebSocket. It also covers WebSocket subprotocols and extensions.
This document discusses a PHP push notification system using MQTT protocol. It requires a Mosquitto MQTT server, Node.js, and Socket.io module to function. The client code connects to the Node.js server via Socket.io and subscribes to topics to listen for notifications. The Node.js code acts as a broker, connecting to the MQTT server and filtering websocket data based on topics. It listens for new notifications from MQTT and sends them to clients via websockets.
Asynchronous Web Programming with HTML5 WebSockets and JavaJames Falkner
(Talk originally given @ KCDC - http://kcdc.info ).
Over the last decade, advances in web computing have removed many of the barriers to entry for developers. New languages, frameworks, and development methodologies have kickstarted new ideas and new ways to develop web applications to make modern life easier and more efficient. WebSockets (introduced as part of HTML5) is one such technology that enables a new class of scalable, super-responsive, collaborative, and real-time web applications with a wide range of uses.
In this talk, we will first cover the basics of asynchronous web programming using WebSockets, including predecessors such as polling and long-polling, applications of WebSockets, its limitations and potential bottlenecks, and potential future improvements.
Next, we will demo and dissect a real-world use case for realtime social data analytics, using the Apache Tomcat implementation of WebSockets and the Java-based Liferay Portal Server. This will include a discussion about development of WebSocket endpoints, its lifecycle within the application container and browser, debugging WebSockets, and scalability topics.
This document discusses WebSockets and Spring WebSockets. It begins by introducing WebSockets as a protocol for real-time full duplex communication over a single TCP connection. It then covers the WebSocket handshake process and JavaScript WebSocket API. Next, it discusses Java WebSocket implementations and how Spring 4 supports WebSockets and the fallback SockJS protocol. Finally, it introduces STOMP as a simple messaging protocol that can be used over WebSockets, and how Spring supports asynchronous messaging using STOMP over WebSockets.
The document discusses WebSockets as a new technology for real-time communication on the web. It presents jWebSocket, an open source framework that supports WebSockets and allows for bidirectional communication between web applications and servers. The framework offers features like messaging, streaming, security and supports multiple platforms and browsers. WebSockets enable use cases like chats, remote monitoring and collaboration that were previously difficult to implement on the web.
WebSockets allow for bidirectional communication between a client and server over a single TCP connection. They improve on older "Comet" techniques which used polling and long-polling to simulate real-time updates. With WebSockets, the client can open a WebSocket connection to the server which sends messages at any time without needing an explicit request. This enables real-time applications with constantly updating information. The document outlines the WebSocket protocol, provides examples of the API in browsers, and discusses frameworks for building WebSocket applications.
The document discusses WebSocket in Java, including:
1. WebSocket is a protocol providing full-duplex communications over a single TCP connection and was standardized by IETF as RFC 6455.
2. Sample WebSocket applications are demonstrated using the JavaWebSocket library, Java EE 7 with Tomcat, and Spring 4 with SockJS for fallback support to older browsers.
3. Code snippets show how to set up WebSocket servers and handlers in each approach to handle connections, messages, and disconnections from clients.
This document discusses using WebSockets for bidirectional communication between a GWT client and server. It provides an overview of setting up WebSocket connections on both the client and server sides in GWT, including writing a JSNI wrapper to initialize the WebSocket on the client. It also discusses using GWT's existing RPC serialization mechanism to serialize and deserialize Java objects sent over the WebSocket connection, avoiding the need for additional serialization libraries. Code examples are provided for initializing the WebSocket and handling messages on both the client and server sides, as well as using GWT's serialization streams to serialize and deserialize objects between the client and server.
Getting Started with WebSocket and Server-Sent Events in JavaArun Gupta
This document discusses WebSocket and Server-Sent Events (SSE) in Java. It provides an overview of WebSocket including the handshake process and lifecycle. It also covers the Java API for creating WebSocket endpoints and handling messages. The document then discusses SSE and the EventSource JavaScript API. Finally, it compares WebSocket and SSE, noting their differences in capabilities and use cases.
This document discusses the purpose, background, and implementation status of web sockets. It describes how web sockets enable bidirectional communication between web applications and servers through a single TCP connection. This overcomes limitations of traditional HTTP where communication was typically one-way from server to client using polling. The document outlines the web socket protocol specification process involving the W3C and IETF and lists some potential application areas.
WebSockets: The Current State of the Most Valuable HTML5 API for Java DevelopersViktor Gamov
WebSockets provide a standardized way for web browsers and servers to establish two-way communications channels over a single TCP connection. They allow for more efficient real-time messaging compared to older techniques like polling and long-polling. The WebSocket API defines client-side and server-side interfaces that allow for full-duplex communications that some popular Java application servers and web servers support natively. Common use cases that benefit from WebSockets include chat applications, online games, and real-time updating of social streams.
HTML5 WebSocket for the Real-Time Weband the Internet of ThingsPeter Moskovits
Abstract: In his talk Peter gives a brief introduction to WebSocket and discusses how real-time Web communications technologies can be applied to an always connected Web and mobile world. Then, he walks you through how to provide interactivity and collaboration by controlling physical objects remotely. The presentation features several live demonstrations of the concepts discussed throughout the session.
This document provides an overview of Jerromy Lee and his work developing interactive media applications and games using technologies like WebSockets, Bluetooth, and peer-to-peer networking. It summarizes Jerromy's background and experience, describes several projects he has worked on including games for McDonald's and Sony, and provides information on the tools and techniques used to develop these types of connected experiences, including JavaScript, EaselJS, Node.js, and Socket.io.
Websockets in Node.js - Making them reliable and scalableGareth Marland
This document discusses implementing websockets in Node.js. It covers popular websocket libraries like Socket.io and Engine.io, considerations for reliability and scalability, and using Redis for pub/sub to allow messages to be passed between servers and achieve scalable websockets. Code examples are provided for setting up websockets on both the client and server sides using Engine.io and Redis.
The document discusses the history and development of WebSockets. It describes how earlier protocols like HTTP, AJAX, and polling had limitations for real-time full-duplex communication needs. WebSockets were created as a new protocol to allow persistent connections and transmission of data between a client and server with low overhead. The document outlines the WebSocket handshake process and API, discusses security considerations, and provides examples of how WebSockets have been used in online games, visualization tools, and other real-time applications.
Simon Willison gave a presentation on Comet, a technique for enabling live data updates in web applications. Comet allows a web server to push events to connected browsers in real-time. It has faced many technical challenges due to browser limitations. Key techniques discussed include streaming, long polling, and the Bayeaux protocol which provides a common way for Comet clients and servers to communicate. The presentation showed how to easily build a basic Comet application using Jetty and Dojo in just a few lines of code.
Presented at the Yahoo! Web Development Summit in December 2007. Comet is the new name for the old trick of streaming events down to the browser from the server. This talk introduces Comet and shows how, despite the terrifying browser tricks needed, it's actually now very simple to build against.
Getting Started with WebSockets and Server-Sent EventsArun Gupta
This document discusses WebSocket and Server-Sent Events (SSE) for building interactive web applications. It provides an overview of WebSocket including how it enables full-duplex communication over a single TCP connection and the handshake process. It also discusses the Java API for WebSocket including annotated endpoints and custom payloads. Finally, it covers SSE, the EventSource API, and an example SSE implementation in Java.
Node.js is an asynchronous event-driven JavaScript runtime that allows JavaScript to be used on the server-side. It uses a non-blocking I/O model that makes it suitable for real-time web applications. WebSockets provide a standardized way for the browser and server to establish two-way communication. However, not all browsers support WebSockets yet. Socket.io addresses this by providing a WebSocket-like experience across all browsers through fallbacks like long-polling. It allows real-time applications to be developed more easily.
This document summarizes a hackathon event where a team worked on developing an iSlide presentation platform. They explored using websockets to enable real-time sharing and editing of slides. They also discussed dynamically generating QR codes and accessing the local network IP address from within Android applications to access the iSlide server.
WebSocket is a protocol that provides full-duplex communication channels over a single TCP connection. It was standardized in 2011 and allows for real-time data exchange between a client and server. The document discusses how WebSocket works, compares it to previous techniques like polling which had limitations, and outlines how to implement WebSocket in Java using JSR 356 and in Spring using the WebSocket API and STOMP protocol.
The document discusses pushing data from a server to a browser using Comet techniques like long polling and streaming. It describes how Comet allows for real-time updates without polling by keeping connections open. The Bayeux protocol is presented as an open standard for implementing Comet with publish/subscribe messaging on both the client-side and server-side in Java. Examples of using Comet for chat applications and sensor data updates are provided.
The document discusses Websockets and compares them to HTTP. It provides an overview of Websockets including how they work, specifications, and examples of using Websockets in JavaScript, Android Java, and Java server-side code with the jquery-websocket library. Benefits highlighted include full-duplex communication, lower overhead than HTTP, and lower latency.
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.
Non-blocking I/O, Event loops and node.jsMarcus Frödin
This 15 minute presentation discusses non-blocking I/O, event loops, and Node.js. It builds on previous work by Ryan Dahl, explaining how threads can be expensive due to context switching and memory usage, and how Node.js uses an event-driven, non-blocking model to avoid these costs. Code examples demonstrate getting and printing a policy object, handling HTTP requests asynchronously without blocking additional connections, and using callbacks to chain asynchronous actions together.
Text Editors (Atom / Sublime)
Apache Server (sftp/ssh/php) – Todd's Server!
CPanel / Wordpress (server side details)
Working with any Web API (Mapping Example)
(facebook, linkedin, twitter, maps, d3.js, jquary)
JSON and HTML <img>
GIT http://www.github.com
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)Ericom Software
WebSockets couples the performance and flexibility of TCP with the reach of HTTP Prediction: WebSockets will replace simple TCP as preferred underlying protocol.
To see how Websockets are used in a popular HTML5-based remote access solution, by visiting the following URL: http://j.mp/1luquBQ
Building Next Generation Real-Time Web Applications using WebsocketsNaresh Chintalcheru
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.
Real-Time Python Web: Gevent and Socket.ioRick Copeland
The document discusses using Gevent and Socket.io for building real-time web applications, providing code examples for building a chat application that uses Gevent for asynchronous programming, Socket.io for client-server communication, and ZeroMQ for inter-process communication between greenlets. It describes the design and implementation of a web-based chat application that allows clients to send and receive messages in real-time using these technologies.
Analyzing the Performance of Mobile WebAriya Hidayat
This document discusses techniques for analyzing the performance of mobile web applications. It covers challenges like network variability, different device hardware, and continuous integration. Approaches mentioned include benchmarking, injecting instrumentation, emulation, and remote inspection. Strategies suggested are reducing complexity, replicating analysis on desktop, and tweaking at the system level. Tools mentioned include the Nexus One, Gingerbread, PhantomJS, and headless WebKit. The document provides examples and caveats for analyzing areas like network traffic, graphics commands, garbage collection, and JavaScript parsing.
Presentation MobileTechCon 2010, Mainz, Germany: Stay Connected - Mobile Pushing Apps with jWebSocket:
Whether on-line games, or online collaboration, streaming, chat, remote control or monitoring applications - real-time communication has long ago moved into cross-platform and cross-browser web solutions. HTML5 WebSockets are the ideal basis for bidirectional high-speed data exchange in real time.
The document discusses how WebSockets provide a standard for real-time communication between web and mobile applications using a bi-directional and low-overhead TCP connection compared to HTTP, and introduces jWebSocket as an open-source library that implements WebSockets and allows developing cross-platform mobile apps with real-time features like chat and collaboration.
The document discusses the need for WebSockets as a replacement for Comet techniques for direct communication between browsers and servers. It explains that WebSockets allow for full-duplex connections over a single TCP connection. The current state of WebSockets is discussed, noting browser and server support is growing but still limited in some cases. Code examples are provided to demonstrate how WebSockets work and establish connections.
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
Socket.io is a JavaScript library for real-time web applications. It enables real-time and bi-directional communication between web clients and servers. It transparently uses various transports like WebSocket, polling, and flash socket depending on client capabilities. It has features for authorization, timeouts, heartbeats, reconnection, and multiple sockets on the same connection. Socket.io can be used to build real-time applications involving websockets, like chat applications.
This document discusses WebSockets and their APIs. It introduces WebSockets as enabling bi-directional, full-duplex communications over TCP, in contrast to traditional HTTP interactions which are half-duplex. It then covers the WebSocket handshake process, APIs for WebSocket in JavaScript and Java, and how to create and use WebSocket endpoints programmatically and using annotations in Java.
Original slides from Ryan Dahl's NodeJs intro talkAarti Parikh
These are the original slides from the nodejs talk. I was surprised not find them on slideshare so adding them. The video link is here https://www.youtube.com/watch?v=ztspvPYybIY
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Erasmo Purificato
Slide of the tutorial entitled "Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Emerging Trends" held at UMAP'24: 32nd ACM Conference on User Modeling, Adaptation and Personalization (July 1, 2024 | Cagliari, Italy)
The DealBook is our annual overview of the Ukrainian tech investment industry. This edition comprehensively covers the full year 2023 and the first deals of 2024.
Quantum Communications Q&A with Gemini LLM. These are based on Shannon's Noisy channel Theorem and offers how the classical theory applies to the quantum world.
Quality Patents: Patents That Stand the Test of TimeAurora Consulting
Is your patent a vanity piece of paper for your office wall? Or is it a reliable, defendable, assertable, property right? The difference is often quality.
Is your patent simply a transactional cost and a large pile of legal bills for your startup? Or is it a leverageable asset worthy of attracting precious investment dollars, worth its cost in multiples of valuation? The difference is often quality.
Is your patent application only good enough to get through the examination process? Or has it been crafted to stand the tests of time and varied audiences if you later need to assert that document against an infringer, find yourself litigating with it in an Article 3 Court at the hands of a judge and jury, God forbid, end up having to defend its validity at the PTAB, or even needing to use it to block pirated imports at the International Trade Commission? The difference is often quality.
Quality will be our focus for a good chunk of the remainder of this season. What goes into a quality patent, and where possible, how do you get it without breaking the bank?
** Episode Overview **
In this first episode of our quality series, Kristen Hansen and the panel discuss:
⦿ What do we mean when we say patent quality?
⦿ Why is patent quality important?
⦿ How to balance quality and budget
⦿ The importance of searching, continuations, and draftsperson domain expertise
⦿ Very practical tips, tricks, examples, and Kristen’s Musts for drafting quality applications
https://www.aurorapatents.com/patently-strategic-podcast.html
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionBert Blevins
Cybersecurity is a major concern in today's connected digital world. Threats to organizations are constantly evolving and have the potential to compromise sensitive information, disrupt operations, and lead to significant financial losses. Traditional cybersecurity techniques often fall short against modern attackers. Therefore, advanced techniques for cyber security analysis and anomaly detection are essential for protecting digital assets. This blog explores these cutting-edge methods, providing a comprehensive overview of their application and importance.
Blockchain technology is transforming industries and reshaping the way we conduct business, manage data, and secure transactions. Whether you're new to blockchain or looking to deepen your knowledge, our guidebook, "Blockchain for Dummies", is your ultimate resource.
Comparison Table of DiskWarrior Alternatives.pdfAndrey Yasko
To help you choose the best DiskWarrior alternative, we've compiled a comparison table summarizing the features, pros, cons, and pricing of six alternatives.
Are you interested in dipping your toes in the cloud native observability waters, but as an engineer you are not sure where to get started with tracing problems through your microservices and application landscapes on Kubernetes? Then this is the session for you, where we take you on your first steps in an active open-source project that offers a buffet of languages, challenges, and opportunities for getting started with telemetry data.
The project is called openTelemetry, but before diving into the specifics, we’ll start with de-mystifying key concepts and terms such as observability, telemetry, instrumentation, cardinality, percentile to lay a foundation. After understanding the nuts and bolts of observability and distributed traces, we’ll explore the openTelemetry community; its Special Interest Groups (SIGs), repositories, and how to become not only an end-user, but possibly a contributor.We will wrap up with an overview of the components in this project, such as the Collector, the OpenTelemetry protocol (OTLP), its APIs, and its SDKs.
Attendees will leave with an understanding of key observability concepts, become grounded in distributed tracing terminology, be aware of the components of openTelemetry, and know how to take their first steps to an open-source contribution!
Key Takeaways: Open source, vendor neutral instrumentation is an exciting new reality as the industry standardizes on openTelemetry for observability. OpenTelemetry is on a mission to enable effective observability by making high-quality, portable telemetry ubiquitous. The world of observability and monitoring today has a steep learning curve and in order to achieve ubiquity, the project would benefit from growing our contributor community.
Best Practices for Effectively Running dbt in Airflow.pdfTatiana Al-Chueyr
As a popular open-source library for analytics engineering, dbt is often used in combination with Airflow. Orchestrating and executing dbt models as DAGs ensures an additional layer of control over tasks, observability, and provides a reliable, scalable environment to run dbt models.
This webinar will cover a step-by-step guide to Cosmos, an open source package from Astronomer that helps you easily run your dbt Core projects as Airflow DAGs and Task Groups, all with just a few lines of code. We’ll walk through:
- Standard ways of running dbt (and when to utilize other methods)
- How Cosmos can be used to run and visualize your dbt projects in Airflow
- Common challenges and how to address them, including performance, dependency conflicts, and more
- How running dbt projects in Airflow helps with cost optimization
Webinar given on 9 July 2024
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...Toru Tamaki
Jindong Gu, Zhen Han, Shuo Chen, Ahmad Beirami, Bailan He, Gengyuan Zhang, Ruotong Liao, Yao Qin, Volker Tresp, Philip Torr "A Systematic Survey of Prompt Engineering on Vision-Language Foundation Models" arXiv2023
https://arxiv.org/abs/2307.12980
Best Programming Language for Civil EngineersAwais Yaseen
The integration of programming into civil engineering is transforming the industry. We can design complex infrastructure projects and analyse large datasets. Imagine revolutionizing the way we build our cities and infrastructure, all by the power of coding. Programming skills are no longer just a bonus—they’re a game changer in this era.
Technology is revolutionizing civil engineering by integrating advanced tools and techniques. Programming allows for the automation of repetitive tasks, enhancing the accuracy of designs, simulations, and analyses. With the advent of artificial intelligence and machine learning, engineers can now predict structural behaviors under various conditions, optimize material usage, and improve project planning.
Coordinate Systems in FME 101 - Webinar SlidesSafe Software
If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights.
During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to:
- Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value
- Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems
- Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors
- Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported
- Look Ahead: Gain insights into where FME is headed with coordinate systems in the future
Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!
2. $ whoami
David Lindkvist
kontain.com/david-lindkvist
twitter.com/ffdead
Application Developer @F_i
Web development is my passion!
Drummer
myspace.com/vildhjarta
myspace.com/terminalfunction
2
3. Agenda
Why do we need WebSockets?
What is it?
How does it work?
When can we use it?
3
5. Why?
Today’s web apps demand reliable event-driven
communications
“Real-time” (minimal latency)
Full duplex
Examples:
Social networking
Online games
Collaborative platforms
Financial applications
etc...
5
6. Why? Problems with HTTP...
It’s hard to achieve real-time apps, primarily due to the
limitations of HTTP
HTTP is half-duplex (traffic flows in only one direction
at a time)
HTTP adds latency and message overhead
6
7. Why? Simulate real-time?
Polling (AJAX)
Poll server for updates, wait at client
Long polling (Comet)
Poll server for updates, wait at the server; uses two
connections and requires unnecessary complexity
Used in Ajax applications to simulate real-time
Leads to poor resource utilization...
7
9. Why? Long Polling
#$%&'($))*%&+,-./*01.02-1
(picture from Kaazing)
!"#$"%$!$
3+!""4+5 6778*%&+9$-:$-70*$%
!"#$"%$!$ !"
!"
9
10. Why? HTTP req/res overhead
GET /PollingStock//PollingStock HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5)
Gecko/20091102 Firefox/3.5.5
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us
Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300 691 chars
Connection: keep-alive
Referer: http://localhost:8080/PollingStock/
Cookie: showInheritedConstant=false;
showInheritedProtectedConstant=false; showInheritedProperty=false;
showInheritedProtectedProperty=false; showInheritedMethod=false;
showInheritedProtectedMethod=false; showInheritedEvent=false; showInheritedStyle=false;
showInheritedEffect=false
HTTP/1.x 200 OK
X-Powered-By: Servlet/2.5 Server: Sun Java System Application Server 9.1_02
Content-Type: text/html;charset=UTF-8
Content-Length: 321
Date: Sat, 07 Nov 2009 00:32:46 GMT
Total 871 chars
(example from Kaazing)
10
11. Why? Header traffic analysis
Example network throughput for Polling HTTP req/resp
headers:
Use case A: 10,000 clients polling every 60 seconds
Network throughput is (871 x 10,000)/60 = 145,166 bytes =
1,161,328 bits per second (1.1 Mbps)
Use case B: 10,000 clients polling every second
Network throughput is (871 x 10,000)/1 = 8,710,000 bytes =
69,680,000 bits per second (66 Mbps)
Use case C: 100,000 clients polling every 10 seconds
Network throughput is (871 x 100,000)/10 = 8,710,000 bytes =
69,680,000 bits per second (66 Mbps)
(example statistics from Kaazing)
11
13. What is a WebSocket?
W3C/IETF Standard
Uses the WebSocket protocol instead of HTTP
True full-duplex communication channel
Both UTF-8 strings and binary frames can be sent in any
direction at the same time
It’s not a raw TCP socket
13
14. What is a WebSocket?
Connection established by “upgrading” from HTTP to
WebSocket protocol
Runs via port 80/443 - Proxy/Firewall friendly
HTTP-compatible handshake
Integrates with Cookie based authentication
WebSockets and Secure WebSockets
ws://
wss://
14
15. What? Upgrade handshake
// browser request to the server
GET /demo HTTP/1.1
Upgrade: WebSocket
Connection: Upgrade
Host: example.com
Origin: http://example.com
WebSocket-Protocol: sample
// server response
HTTP/1.1 101 Web Socket Protocol Handshake
Upgrade: WebSocket
Connection: Upgrade
WebSocket-Origin: http://example.com
WebSocket-Location: ws://example.com/demo
WebSocket-Protocol: sample
15
16. What? Reduces Network Traffic
Each message (“frame”) has only 2 bytes of overhead
No latency from establishing new TCP connections for
each HTTP message
No polling overhead - only sends messages when
there is something to send
16
17. What? Header traffic analysis
Example network throughput for WebSocket req/res
headers:
Use case A: 10,000 frames every 60 seconds
Network throughput is (2 x 10,000)/60 = 333 bytes = 2,664 bits
per second (2.6 Kbps) [was 1.1 Mbps]
Use case B: 10,000 frames every second
Network throughput is (2 x 100,000)/1 = 20,000 bytes = 160,000
bits per second (156 Kbps) [was 66 Mbps]
Use case C: 100,000 frames every 10 seconds:
Network throughput is (2 x 100,000)/10 = 20,000 bytes = 160,000
bits per second (156 Kbps) [was 66 Mbps]
(example statistics from Kaazing)
17
18. What? Overheard
"Reducing kilobytes of data to 2 bytes...and reducing
latency from 150ms to 50ms is far more than marginal.
In fact, these two factors alone are enough to make
WebSocket seriously interesting to Google.“
- Ian Hickson (Google, HTML5 spec lead)
18
20. How? The WebSocket interface
[Constructor(in DOMString url, in optional DOMString protocol)]
interface WebSocket {
readonly attribute DOMString URL;
// ready state
const unsigned short CONNECTING = 0;
const unsigned short OPEN = 1;
const unsigned short CLOSING = 2;
const unsigned short CLOSED = 3;
readonly attribute unsigned short readyState;
readonly attribute unsigned long bufferedAmount;
// networking
attribute Function onopen;
attribute Function onmessage;
attribute Function onerror;
attribute Function onclose;
boolean send(in DOMString data);
void close();
};
WebSocket implements EventTarget;
20
21. How? The Javascript client
connect: function () {
try {
this.ws = new WebSocket(’ws://www.example.com’);
this.ws.onopen = function (event) {/*...*/};
this.ws.onclose = function (event) {/*...*/};
this.ws.onmessage = messageListener;
}
catch(exception) {}
},
messageListener: function (event) {
alert(’New message: ’ + event.data)
},
send: function (message) {
if (this.ws) {
this.ws.send(message);
}
},
21
22. How? The server
Server implementations (mostly experimental):
Kaazing WebSocket Gateway (production since april 2009)
phpwebsockets
web-socket-ruby
mod_pywebsocket
JWebSocket
Jetty WebSocketServlet
and many more...
22
23. How? Jetty server example
public class MyServlet extends HttpServlet implements Servlet
{
// trigger on HTTP GET request
public void doGet(HttpServletRequest req, HttpServletResponse res) {}
// trigger on HTTP POST request
public void doPost(HttpServletRequest req, HttpServletResponse res) {}
// doWebSocket() ???
}
23
24. How? Jetty server example
public class ChatServiceServlet extends WebSocketServlet implements Servlet
{
public void doGet(HttpServletRequest req, HttpServletResponse res) {}
public void doPost(HttpServletRequest req, HttpServletResponse res) {}
// trigger on request to upgrade to WebSocket connection
protected WebSocket doWebSocketConnect(HttpServletRequest req, String arg) {
return new ChatWebSocket();
}
// shared resource - needs to be thread safe!
Set<ChatWebSocket> clients = new CopyOnWriteArraySet<ChatWebSocket>();
class ChatWebSocket implements WebSocket {
/* impl on next slide... */
}
}
24
25. How? Jetty server example
class ChatWebSocket implements WebSocket {
Outbound outbound;
public void onConnect(Outbound outbound) {
this.outbound = outbound;
clients.add(this);
}
public void onMessage(byte frame, String data) {
for (ChatWebSocket socket : clients) {
try {
socket.outbound.sendMessage(frame, data);
}
catch(IOException e) {}
}
}
public void onDisconnect() {
clients.remove(this);
}
}
25
26. How? It’s not a silver bullet
How should we handle the “close” event?
Application must be prepared to reopen connection if
close event was triggered unexpectedly
Idle timeout
Network errors
26
27. How? It’s not a silver bullet
Keep-alives
Sending keep-alive messages to prevent closing due to an idle
timeout
No timeout discovery available on the WebSocket
Keep-alives don’t avoid the need for handling “close” events
WiFi connections and mobile devices
27
28. How? It’s not a silver bullet
Queues
Buffer messages that failed to send due to a transient network
problem
Resend queue when connection is restored
Important for both server and client
28
29. How? It’s not a silver bullet
Timeouts
Not all network problems are transient
Can’t allow queues to grow for ever
Applications need a timeout when user is considered to be
disconnected
Need to implement an explicit close message for application to
distinguish between network failures and an orderly close
29
30. How? It’s not a silver bullet
Message Retries
Even with queues we can’t know for sure messages are
delivered due to race condition
If close event is triggered soon after a message was sent?
For quality of service to be guaranteed an acknowledge
message would have to be sent for each message
Ideally a future version of WebSockets would support an
orderly close event
30
31. How? It’s not a silver bullet
onclose handing, keep-alives, message queues,
timeouts and retries, introduce more problems:
If server goes down client will loop trying to reconnect
Needs a retry backoff algorithm to reduce retries over time
Message size can cause connection to die if it exceeds some
resource limit on client or server
Looks like a transient network error...
Connection is restored and retries to send same message from
queue...
Infinite loop!
31
34. When? Browser support
Status of native WebSocket support for other browsers
(2010-04-11):
Firefox - targeted for the v3.7 release but not yet in 3.7a4pre
Safari - announced for 4.x but no target date yet
Opera - 10.x already 95% HTML5 compatible but WebSockets
missing
IE 8.x - 9.x unknown
(reference: jWebSocket project)
34
35. When?
Graceful degradation for the next ~10 years....
Realtime apps:
Java Applet TCP Socket
Flash XMLSockets over TCP
Long polling over HTTP
Not so realtime apps:
Polling using periodical pulls over HTTP
35
36. When?
Providing fallbacks mean more work.
More works sucks..
Solution: Look for a client library which implements the
WebSocket interface!
Kaazing
jWebSocket
Users will be able to take advantage of true WebSockets when
their browser supports it
36
37. When?
Or... roll your own!
Introducing the Graceful WebSocket:
A jQuery plugin implementing the WebSocket interface
One interface = one implementation
Uses the native WebSocket if available
Automatic fallback on HTTP polling
37
38. Get involved?
Visit the Graceful WebSocket project over at Google
Code:
http://code.google.com/p/jquery-graceful-websocket/
38
39. Summary
Allows us to write real-time, event driven applications
Better resource utilization, less latency, less network
overhead
Browser support so far is poor
Specification is not finalized
39
40. References?
W3C The WebSocket API
HTML5 Communications - Frank Greco (Kaazing)
jfokus 2010
http://en.wikipedia.org/wiki/Web_Sockets
Greg Wilkins Jetty WebSocket Server
Greg Wilkins Websocket Chat
http://jwebsocket.org/
40