@Override
	public void run() {
		try {
			reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
			writer = new PrintWriter(socket.getOutputStream(), true);

			// Read client requests
			while ((request = reader.readLine()) != null) {
				String parts[] = request.split("_");

				switch (parts[0]) {

				case "login":
					writer.println(login(parts));
					break;
				case "logout":
					writer.println(logout(parts));
					break;
				case "credits":
					writer.println(credits(parts));
					break;
				case "buy":
					writer.println(buy(parts));
					break;
				case "list":
					writer.println(list(parts));
					break;
				case "compute":
					writer.println(compute(parts));
					break;
				default:
					writer.println("Unknown command, please try again with a known command");
					break;
				}

			}
		} catch (IOException e) {
			System.out.println("ERROR: " + e.getMessage());
		}
	}