package mug13; /* * ReceiveThread constantly looks for messages * from the server and prints received messages * on a client's screen * * @author Brett McMillian * */ import java.net.*; import java.io.*; public class ReceiveThread extends Thread { Socket clientSocket; ObjectInputStream ois; public ReceiveThread(ObjectInputStream objectIS) { this.ois = objectIS; } public void run() { try { while(true) { //Receive a string from the server String instructions = (String) this.ois.readObject(); //Print the string on the clients terminal window System.out.println(instructions); } } catch (UnknownHostException e) {} catch (IOException e) {} catch (ClassNotFoundException e) {} } }