equal
deleted
inserted
replaced
175 accept.setDaemon(true); |
175 accept.setDaemon(true); |
176 } |
176 } |
177 |
177 |
178 void start() throws IOException { |
178 void start() throws IOException { |
179 ss.setReuseAddress(false); |
179 ss.setReuseAddress(false); |
180 ss.bind(new InetSocketAddress(0)); |
180 ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); |
181 accept.start(); |
181 accept.start(); |
182 } |
182 } |
183 |
183 |
184 // Pipe the input stream to the output stream. |
184 // Pipe the input stream to the output stream. |
185 private synchronized Thread pipe(InputStream is, OutputStream os, |
185 private synchronized Thread pipe(InputStream is, OutputStream os, |
209 } |
209 } |
210 }; |
210 }; |
211 } |
211 } |
212 |
212 |
213 public InetSocketAddress getAddress() { |
213 public InetSocketAddress getAddress() { |
214 return new InetSocketAddress( |
214 return new InetSocketAddress( InetAddress.getLoopbackAddress(), ss.getLocalPort()); |
215 "localhost", |
|
216 ss.getLocalPort()); |
|
217 } |
215 } |
218 |
216 |
219 // This is a bit shaky. It doesn't handle continuation |
217 // This is a bit shaky. It doesn't handle continuation |
220 // lines, but our client shouldn't send any. |
218 // lines, but our client shouldn't send any. |
221 // Read a line from the input stream, swallowing the final |
219 // Read a line from the input stream, swallowing the final |