# Design ## Protocol ### Types | TYPE 1 => Request, a new request 2 => Result, the result #### Request types | REQUEST 1 => New server client 2 => New desktop client 3 => Data #### Response types | RESPONSE 1 => OK 2 => Created 3 => Not OK #### Data types | DATA CPU_USAGE => FLOAT => Percentage of CPU usage ### Server Client 1. When a client wants to connect to the server it sends an initial request detailing the type of it is, e.g. desktop client or server client. ```json { "TYPE": 0, "REQUEST": 0, "HOSTNAME": "ASGARD" } ``` 2. Server sends back the following response ```json { "TYPE": 1, "RESULT": 0 } ``` 3. Client starts ```json { "TYPE": 0, "REQUEST": 2, "HOSTNAME": "ASGARD", "DATA": { "TIMESTAMP": , "CPU_USAGE": 50, "MEMORY_USAGE": 50, "MEMORY_USED_GB": 1 } } ```