?? clientrecievethread.java
字號:
package org.jetic.web.chat;/** * Title: 經(jīng)天網(wǎng)絡(luò) * Description: * Copyright: Copyright (c) 2000<br> * Company: www.jetic.com 經(jīng)天<br> * @author hover * @version 1.0 */import java.io.*;import java.net.*;public class ClientRecieveThread extends Thread { private ChatApplet applet = null; private Socket socket = null; public ClientRecieveThread(Socket socket, ChatApplet applet) { this.socket = socket; this.applet = applet; } public void run() { BufferedReader in = null; String inputLine; try { in = new BufferedReader( new InputStreamReader( socket.getInputStream())); while ((inputLine = in.readLine()) != null) { //if (inputLine.equalsIgnoreCase("quit")) break; applet.appendMessage(inputLine + "\n"); } } catch (Exception ex) { ex.printStackTrace(System.err); } finally { Close(); } } void Close() { try { socket.close(); } catch (Exception ex) { ex.printStackTrace(System.err); } }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -