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
- You must manually make all the content (but you could also use a lib)
- The socket must be made
- Typically the connection is
unidirectionalfrom the person1 to person2 which will respond and close the connection (web sockets fix this issue)
- The response must be parsed manually (not sure why that is an issue you could use JSON and a lib)