/**
* 客户端线程接收类
* @author 
*
*/
public class ClientRecive extends Thread{

public Socket socket;

public ClientRecive(Socket socket) {
super();
this.socket = socket;
}

@Override
public void run() {
try {
while(true){
InputStream is = socket.getInputStream();
byte[] b = new byte[1024];
int len = is.read(b);
System.out.println(new String(b,0,len).trim());
}



} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

相关文章:

  • 2021-04-20
  • 2021-07-14
  • 2021-08-03
  • 2022-12-23
  • 2021-05-19
  • 2021-04-03
  • 2022-12-23
猜你喜欢
  • 2021-08-26
  • 2022-12-23
  • 2021-12-24
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案