equal
deleted
inserted
replaced
37 ServerSocket server = new ServerSocket (0); |
37 ServerSocket server = new ServerSocket (0); |
38 int port = server.getLocalPort(); |
38 int port = server.getLocalPort(); |
39 System.out.println ("listening on " + port); |
39 System.out.println ("listening on " + port); |
40 B6890349 t = new B6890349 (server); |
40 B6890349 t = new B6890349 (server); |
41 t.start(); |
41 t.start(); |
42 URL u = new URL ("http://127.0.0.1:"+port+"/foo\nbar"); |
42 URL u = new URL("http", |
|
43 InetAddress.getLoopbackAddress().getHostAddress(), |
|
44 port, |
|
45 "/foo\nbar"); |
|
46 System.out.println("URL: " + u); |
43 HttpURLConnection urlc = (HttpURLConnection)u.openConnection (); |
47 HttpURLConnection urlc = (HttpURLConnection)u.openConnection (); |
44 InputStream is = urlc.getInputStream(); |
48 InputStream is = urlc.getInputStream(); |
45 throw new RuntimeException ("Test failed"); |
49 throw new RuntimeException ("Test failed"); |
46 } catch (IOException e) { |
50 } catch (IOException e) { |
47 System.out.println ("OK"); |
51 System.out.println ("OK"); |