I'm writing a java socket program to read data from server, I've no control to server, below is protocol agreed,
- 2-bytes: magic number
- 2-bytes: data length
- N-bytes: ASCII string data payload
- Big endian for the magic number and data length
For Example: if my request is "command/1/getuserlist" how to construct th request match above protocol and read the response back to List
I'm new to socket programming and have no idea how to build my request and read the response back.
can someone guide me how to build the request and read the response from