本帖最后由 黑马连家华 于 2012-8-26 21:48 编辑
public class JS03
{
public static void main(String[] args) throws Exception
{
ServerSocket ss = new ServerSocket(10000);
String ip = ss.getInetAddress().getHostAddress();
System.out.println(ip+"...connected");
Socket s = ss.accept();
InputStream in = s.getInputStream();
byte[] buffer = new byte[1024];
int length = in.read(buffer);
System.out.println(new String(buffer,0,length));
OutputStream out = s.getOutputStream();
PrintWriter pw = new PrintWriter(out,true);
pw.println("<font size=7 color=green>注册失败</font>");
s.close();
ss.close();
}
}
用浏览器做客户端 浏览器收不到 注册失败 字样
服务端可以收到浏览器发送的信息
求教哪里错了 |
|