ungureanuvladvictor

Untitled

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