Chapter 10: WebSockets

¡Supera tus tareas y exámenes ahora con Quizwiz!

Socket.IO

client code and server side are JS (server is node.js). switches between websocket, ajax long polling, or flash polling

how can you attempt to prevent timeouts with websockets?

create a timer that will send empty messages on an interval to keep the connection active

how do you open a websocket connection?

instantiate the WebSocket object, and it automatically attempts to open asynchronously

web farm

multiple server handling incoming requests

websocket.ReadyState

CONNECTING = 0 Connection is not yet open. OPEN = 1 Connection is open and ready to communicate. CLOSING = 2 Connection is in the process of closing. CLOSED = 3 Connection is closed or couldn't be opened.

Do the WebSocket protocol and WebSocket API provide native support for load balancing in a web farm?

no

what 4 events do you implement on the websocket object?

onopen, onmessage, onerror, and onclose

WebSocket Protocol

provides a standardized way for the server to send content to the browser without being solicited by the client and to allow messages to be passed back and forth while keeping the connection open

long polling

replaced by websockets; client sends a request to the server, and if the server has information with which to respond, it responds. If the server doesn't have information with which to respond, the server keeps the connection open and doesn't respond until it has data. When the client receives the data, it sends another request to the server, and the sequence repeats itself

SignalR

websocket library that switches between long polling and websockets depending on what is available. For ASP.NET, client side is JS

where can you access the websocket object from?

window.

websocket url "protocol"

ws:// or wss://


Conjuntos de estudio relacionados

Econ 212 Chapter 10 Review Questions

View Set

Sociology: Final Study Guide (Chapter 14)

View Set

Chapter 6: Group Health Insurance

View Set

Chapter 6 - Introduction to Internal Control Systems and Risk Management

View Set

Chapter 28: Drugs Used to Treat Heart Failure

View Set

GEO101 Exam 2 Terms & Practice Questions

View Set