Implementar um protocolo da camada de aplicação para distribuir arquivos de texto. O protocolo é bem simples e está especificado abaixo::
101 PASSWD <string>
102 ACCESS <filename>
103 QUIT
901 OK
902 UNKNOWN
903 UNAUTHORISED
904 NOT FOUND
905 EOF
The commands may give rise to different responses:
101 PASSWD
the server will return 901
OK
if correct; and 903 UNAUTHORISED
if incorrect. Use a
fixed, hard-coded password for the exercise.
102 ACCESS
the server will return 903
UNAUTHORISED
if a correct password has not been provided already; 904
NOT FOUND
if the file does not exist; or if the file exists then the
server should return 901 OK
; followed by the file, line by
line; followed by a 905 EOF
.
103 QUIT
the server should respond
901 OK
then close its various connection handling objects. The
client should close its connection handlers on receiving the OK.
902
UNKNOWN
.