Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Write a GUI-based multithreaded network server program. The program is a
- simple file server that makes a collection of files available for transmission to
- clients. When the server starts up, it gets the name of the directory that contains
- the collection of files as a command-line argument.
- When a client connects to the server, the server first reads a one-line command from the
- client. The command can be the string "index". In this case, the server responds by
- sending a list of names of all the files that are available on the server. Or the command
- can be of the form "get <file>", where <file> is a file name. The server checks whether
- the requested file actually exists. If so, it first sends the word "ok" as a message to the
- client. Then it sends the contents of the file and closes the connection. Otherwise, it sends
- the word "error" to the client and closes the connection
Advertisement
Add Comment
Please, Sign In to add comment