Socket服务端代码,这几天搞搞Socket
easyjava吧
全部回复
仅看楼主
level 8
噢丶Right 楼主
public Server(){
try {
//创建服务,端口为9988
ss=new ServerSocket(9982);
while (true) {
//监听窗口,等待连接
socket=ss.accept();
in=new BufferedReader(new InputStreamReader(socket.getInputStream()));
out=new PrintWriter(socket.getOutputStream(),true);
String line=in.readLine();
out.print("---------"+line);
out.close();
in.close();
socket.close();
}
//ss.close();
} catch (IOException e) {
e.printStackTrace();
}
}
2013年07月08日 07点07分 1
level 9
2013年07月08日 07点07分 2
鸭的,鸭子一直活着!我以为早屎了!
2013年07月08日 07点07分
回复 噢丶Right :必须活着,没看吧,吧里如此干净没垃圾贴么,都是我的功劳!!!哇哈哈&……小小得瑟下!抢枪功!
2013年07月08日 17点07分
level 9
2013年07月09日 16点07分 3
1