try {
BaseClient c = new ConsoleClient("localhost", port);
String text = reader.readLine();
while (!text.equalsIgnoreCase("q") && !text.equalsIgnoreCase("quit")) {
c.Send(text);
text = reader.readLine();
}
c.Close();
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.