package com.wenqier.get; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.ServerSocket; import java.net.Socket; import javax.swing.JLabel; import javax.swing.JTextArea; /** * 接收客户端的消息 * @author wenqier * */ public class GetMessage extends Thread { private int i; String v; JLabel label = null; private JTextArea text; public GetMessage(int i, JTextArea text) { this.i = i; this.text = text; } public void run() { try { ServerSocket so = new ServerSocket(i); Socket s = so.accept(); while (true) { InputStreamReader i = new InputStreamReader(s.getInputStream()); BufferedReader b = new BufferedReader(i); v = b.readLine(); text.append("对方说:" + v + "\n"); } } catch (IOException e) { text.append("对方下线了。。。"); } } }
最近下载更多
zeng1206 LV5
2023年12月28日
微信网友_6712701718712320 LV1
2023年10月29日
yitian111 LV1
2021年10月5日
kraynxn LV8
2021年9月28日
lyws1986 LV17
2021年7月19日
王小懒猪 LV1
2021年6月29日
tim135790 LV1
2021年4月18日
liangge2115 LV27
2021年1月1日
zxp888 LV4
2020年12月18日
zaq123zaq LV10
2020年12月10日
最近浏览更多
zeng1206 LV5
2023年12月28日
微信网友_6712701718712320 LV1
2023年10月29日
阿超在大学修仙 LV1
2023年9月15日
qq1357574774 LV1
2023年7月20日
fuyouou LV5
2023年6月26日
1WQAQW1 LV2
2023年6月12日
aixiao5213 LV1
2022年12月28日
106sadadwd LV2
2022年6月18日
zdm1231 LV2
2022年6月5日
xingbing LV9
2022年1月28日