Client-server architectures & Revisiting sockets, TCP, HTTP

Socket

Socket - is an endpoint of a two way communication over a network, made by the server

Sockets are made using the IP and the Port.

Sockets dont do:

Mapping - of complex request parameters into byte streams

Resolution - defining how diverse the data is

Identification - of other sockets

Implementation - you will have to define any protocol such as HTTP

How could a server handle multiple users

Using a load balancer.

Communication Protocol (HTTP)

Syntax

GET {url/path} HTTP/1.1
// this need to be a /r/n
{content of the message}

Complexities

  1. You must manually make all the content (but you could also use a lib)
  1. The socket must be made
  1. Typically the connection is unidirectional from the person1 to person2 which will respond and close the connection (web sockets fix this issue)
  1. The response must be parsed manually (not sure why that is an issue you could use JSON and a lib)