Socket.io
Review, Research, and Discussion
What is the benefit of transforming data into packets?
-
packets are basic units of communication over TCP/IP networks
-
data is transformed into smaller pieces
-
sending smaller units of data helps with the transmission of data
-
TDM-based networks must transform into packet-based networks to meet the demands of pervasive data-centric applications and services. Packet-based networks not only enable new innovations, services, and business opportunities, they are also the most cost-effective, efficient, and scalable networks for content delivery.
-
to transfer the file in faster ansd efficient manner, over the network, and to minimize the transmission latency, by broke the data into small pieces of variable length.
UDP is often refereed to as a connectionless protocol. Why is this?
-
UDP is a connectionless protocol. It is known as a datagram protocol because it is analogous to sending a letter where you don’t acknowledge receipt. Examples of applications that use connectionless transport services are broadcasting and tftp .
-
UDP doesn’t establish a connection before sending data.
Can a socket server application have multiple socket connections?
### Yes, a socker server application can have many socket connections, Multiple connections on the same server can share the same server-side IP/Port pair as long as they are associated with different client-side IP/Port pairs, and the server would be able to handle as many clients as available system resources allow it to
Can a socket connection application be connected to multiple socket servers?
### Yes, a socket connection application can be connected to multiple socket servers.Thus the server can have many TCP sockets using the same local port, as long as each of the sockets on the port is connected to a different remote location. Theoretically, yes. Practice, not.
Can an application be both a socket server and a socket connection?
### Yes, an application can be both a socket server and a socket connection. if you want to use a client socket and a server socket within a single application, then yes! You can do that if you’re willing to use two different ports. Or if the sockets won’t be using the same port at the same time. The main difference between a client and server is that the server is continuously waiting for a client to connect so data can be exchanged by both. The client is generally just making quick connections and will close again so the client port can be used for another task.
Document the following Vocabulary Terms
-
Observer Pattern : s a software design pattern in which an object, named the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods
-
Listener : is a procedure in JS that waits for an event to occur
-
Event Handler : a function that runs when a specific event occurs.
-
Event Driven Programming : Event driven” is a programming paradigm that consists of user actions/interactions that trigger the next flow of events. Modern dynamic apps are built to respond to events, user clicks, voice commands, and other interactions in an asynchronous programming model.
-
Event Loop : design pattern that executes and reacts to events by monitorying the call stack and callback queue
-
Event Queue :A queue containing the operations that should be sent for execution , is a repository where events from an application are held prior to being processed by a receiving program or system.
-
Call Stack : The call stack contains the order that an interpreter needs to perform called functions .
-
Emit/Raise/Trigger : used to trigger an event , in event-driven programming, emit sends a message to trigger a response and raise an event .
-
Subscribe :subscribe dom events in browser or node.js events ,to listen to or keep track of a certain event .
-
database : An organized collection used to systematically store persistant data .
Preview
Which 3 things had you heard about previously and now have better clarity on?
### event driven programming, web sockets, TCP
Which 3 things are you hoping to learn more about in the upcoming lecture/demo?
### Event queues, databases, Triggers
What are you most excited about trying to implement or see how it works?
### Event driven programming, event loop, socket.io
Preparation Materials
what is TCP?
The Transmission Control Protocol (TCP) is widely used by application-layer protocols in the Internet Protocol Suite. TCP creates two-way communication between two hosts and provides reliable, ordered, and error-checked byte streams between the applications.
-
TCP data transfers manage network congestion and use flow control to limit the rate a sender transfers data to guarantee reliable delivery.
-
Each IP packet between the hosts carries a single TCP Segment.
-
A TCP segment is made up of header and data sections.