import java.net.*;
import java.io.*;
class ServerDemo
{
public static void sop(Object obj)
{
System.out.println(obj);
}
public static void main(String[] args) throws Exception
{
ServerSocket ss=new ServerSocket(11000);
Socket s=ss.accept();
sop(s.getInetAddress().getHostAddress());
PrintWriter out=new PrintWriter(s.getOutputStream(),true);
out.println("客户端你好");
s.close();
ss.close();
}
}
大家看下 这个server编译开启后,为啥网页IP+端口不能不能访问呢?? |