telent命令行
D:\a\day0814>telnet 192.168.0.100 11000
演示客户端和服务端
1,
客户端:浏览器
服务端:自定义
/*
演示客户端和服务端
1,
客户端:浏览器
服务端:自定义
*/
import java.io.*;
import java.net.*;
class ServerDemo
{
public static void main(String[] args) throws Exception
{
ServerSocket ss = new ServerSocket(11000);
Socket s = ss.accept();
System.out.println(s.getInetAddress().getHostAddress());
PrintWriter out = new PrintWriter(s.getOutputStream(),true);
out.println("<font color='red' size=7>客户端你好</font>");
s.close();
ss.close();
}
}