package sat.mockServer;
import sat.*;
import java.io.*;
import java.net.*;
// Copyright (c) 2002 Rick Mugridge, University of Auckland.
// Released under the terms of the GNU General Public License version 2 or later.
/** A server that receives "Hello", sends back "Hi" and then expects
a ShutDown from one client. It expects to receive "Hello2" and sends
back "Hi2" from a second client.
@author rick mugridge, october 2002
*/
public class ServerTwoConnections extends ServerHelloHi {
public ServerTwoConnections() {
this(1234);
}
public ServerTwoConnections(int portNo) {
super(portNo);
}
public void manageConnections(ServerSocket server) throws IOException {
super.manageConnections(server);
new ServerThread(server.accept(),"Thread2") {
protected void check(BufferedReader in,
PrintStream out) throws IOException {
if (expectedMessage(""))
out.println("");
expectShutdown();
}
};
}
}