使用ServerSocket(int port)来进行监听
ServerSocket ss = new ServerSocket(port);
Socket s = null;
//进行监听
if (ss!=null){
try{
s = ss.accept();
} catch (Exception e){}
}
//写端口
PrintStream pw = new PrintStream(s.getOutputStream());
pw.print("hello");
ServerSocket ss = new ServerSocket(port);
Socket s = null;
//进行监听
if (ss!=null){
try{
s = ss.accept();
} catch (Exception e){}
}
//写端口
PrintStream pw = new PrintStream(s.getOutputStream());
pw.print("hello");
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货