DataInputStream userInput;
String theLine;
DatagramPacket theOutput;
try {
userInput = new DataInputStream(System.in);
while (true) {
theLine = userInput.readLine();
if (theLine.equals(".")) break;
byte[] data = new byte[theLine.length()];
theLine.getBytes(0, theLine.length(), data, 0);
theOutput = new DatagramPacket(data, data.length, server, echoPort);
theSocket.send(theOutput);
Thread.yield();
}
eot.stop();
} // end try
catch (IOException e) {
System.err.println(e);
}