Commit e084e5f7 authored by tammam.alsoleman's avatar tammam.alsoleman

create QuizServer

parent ce9fa9ce
package org.example.server;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
public class QuizServer {
public static void main(String[] args) {
try {
QuizServiceImpl quizService = new QuizServiceImpl();
Registry registry = LocateRegistry.createRegistry(1099);
registry.rebind("QuizService", quizService);
System.out.println("Quiz Server is running and ready...");
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
System.out.println("\nServer is shutting down...");
quizService.saveScoresToFile();
}));
} catch (Exception e) {
System.err.println("Server exception: " + e.toString());
e.printStackTrace();
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment