ITP Blog

Socket.io and Something I Do That Is Absurd

Collective Play — February 10, 2021

Something I Do That Is Absurd

For the past three weeks I had been loading my to-do list with over 7 tasks. The problem is that there was no day when I could actually accomplish att 7+ tasks I set for myself, to do that I would need at least 36 hours a day and never get tired. But even after three weeks of never being able to complete all the tasks, I keep doing that. Is that a subconscious thing or I am just too much of a hustler?

Socket.io

Omg, I created my own chat!!! With unique usernames!

My Amazeball Chat

Here is how it works on the client-server side.

Diagram with Server and Clients

The client sends the data with the name 'message', which contains object data, which has the client's id and the contents of the message. The server receives the data and then sends it to all the sockets the data with the name 'messages'.

The algorithm in the client sketch is also presented below.

Client Sketch Logic

You can view the code here.


© built during the year of masks and social distancing by yonaymoris with Gatsby