代码如下:
public void run() {
try {
........
while (true) {
...... do {
System.out.println("请输入发送信息,每次一行回车表示,输入other结束当前会话,exit退出程序:");
BufferedReader usrinput = new BufferedReader(
new InputStreamReader(System.in));
theLine = usrinput.readLine();
if (theLine.equals("exit")) {
String x = "&over!&" + this.moudle;
byte[] y = x.getBytes();
DatagramPacket disconnect = new DatagramPacket(y,
y.length);
socket.send(disconnect);
socket.disconnect();
System.exit(0);
}
if (!theLine.equals("other")) {
theLine = id + "%" + this.moudle + "$" + theLine;
byte[] data = theLine.getBytes(); DatagramPacket output = new DatagramPacket(data,
data.length); socket.send(output);
}

} while (!theLine.equals("other"));
Thread.yield();
}
} catch (IOException e) {
e.printStackTrace();
} }
我输入exit后,System.exit(0)之前的代码都执行了,但就是程序无法终止运行,这是为何?如何解决?