TCP-IP协议综述-北理工(20)
发布时间:2021-06-05
发布时间:2021-06-05
北理工 通信网络基础大作业
Server Thread
package com.wang.server;
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.OutputStream;
import java.io.OutputStreamWriter; import .Socket; import java.util.Iterator; import java.util.Map; import java.util.Set;
import com.wangcanpei.util.Util;
public class ServerThread extends Thread{ private Socket socket;
OutputStream os = null; BufferedWriter bw = null; BufferedReader br = null; InputStream is = null;
public ServerThread(Socket socket){ this.socket=socket; }
public void write(String line){ try {
bw.write(line + "\r"); bw.flush();
} catch (IOException e) {
// TODO Auto-generated catch block e.printStackTrace(); } }
public void run() {
上一篇:农村饮水安全项目建设资金管理办法