OTP Server (Java)

import java.util.*; import java.io.*; import java.net.*; class TimeOutTask extends TimerTask { boolean isTimedOut = false; public void run() { isTimedOut = true; } } class OTPServer { public static void main(String args[]) throws IOException { ServerSocket serverSocket = new ServerSocket(7777); System.out.println(“Server running and waiting for client…”); Socket clientSocket = serverSocket.accept(); PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true); BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); // Server waits … Continue reading OTP Server (Java)