首页 > > 详细

解析Service Java编程、Java Service 程序讲解、讲解Java程序、Java语言讲解留学生

import java.io.DataInputStream;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;
public class Service {
public static void main(String[] args) throws Exception {
ServerSocket server = new ServerSocket(10000);
byte[] msg = new byte[20];
//
Socket client = server.accept();
//,8266
InputStream in = new DataInputStream(client.getInputStream());
//,8266
boolean accept = true;
while (accept) {
//
in.read(msg);
System.out.println(new String(msg));
}
in.close();
client.close();
server.close();
}

}

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!