Name: Marbien Jimeno Class: CMPS 4350 Assignment: Lab 6 1. Primary Programming Language We will be utilizing Javascript to facilitate software communication; more specifically, the SocketIO library. SocketIO is a Javascript library that will enable real-time, bidirectional and event-based communication between client browsers and a server. How it works is that client browsers will attempt to establish a WebSocket connection if possible, and will fall back on HTTP if not. WebSocket is a communication protocol providing full-duplex and low-latency channels between client browsers and servers. SocketIO clients can be considered as a "slight" wrapper around the WebSocket API. 2. Compiled or Interpreted? Early Javascript engines were purely interpreters. However, as Javascript became more commonly used, the loss of performance caused by interpretation gave way to new engines. The modern Javascript engine utilizes JIT (just-in-time) compilation. JIT compilers, however, do not perform identically to other compilers such as C++ compilers. In C++, the compiler has lots of time to optimize during compilation. With JIT compilers, Javascript code is only compiled to executable bytecode when just when it is about to run. 3. Underlying Components of Communication High-level: As explained in the first section, a high-level view of SocketIO can be described as primarily a client-server relationship. A NodeJS server is used to establish communication between clients. In other words, to establish communication with other clients, client browsers must first establish connection with the server. This design allows a chat server to broadcast to all or certain client connections. Messages between client browsers must go through the chat server that provides the connection between all client connections. Low-Level: To establish communication and exhange data between client and servers, SocketIO utilizes an underlying standard called EngineIO; SocketIO is built on top of EngineIO. EngineIO facilitates the lower-level implementation of SocketIO under the hood. EngineIO is used for the server implementation and EnginIO-client is for the client. Although SocketIO brings to mind WebSockets, a browser implementation allowing bi-directional communication, SocketIO does not use this as a standard. SocketIO first creates a long-polling connection using xhr-polling. Then, once this is established, it upgrades to the best connection method available, which is usually Websockets. 4. Waiting... The main type of waiting utilized in our application will be asynchronous waiting. The Server instance emits an event which is fired upon a new connection. Until then, while the server is active, the server event asynchronously listens to client connections facilitated by SocketIO. Each new connection is assigned a random 20-character identifier (by referencing the underlying EngineIO server). On the client side, client browsers will fire a connect instance in an effort to establish connection with the server. It, too, will utilize an asychronous waiting scheme until the server confirms that the connection was successful. As previously detailed, a low-level long-polling is first established before upgrading to the higher-level and more efficient WebSocket connection.