01: package examples;
02:
03: import java.io.*;
04: import java.util.*;
05: import vicazh.hyperpool.stream.net.http.*;
06:
07: class ExampleServiceServerStream extends ServerStream {
08:
09: ExampleServiceServerStream(Session session,
10: OutputStream outputstream) {
11: super (session, outputstream);
12: }
13:
14: public void header() throws IOException {
15: StringBuffer result = new StringBuffer();
16: result.append("Server HTTP header ("
17: + session.getClient().getFile() + ")\r\n\r\n");
18: result.append("version: " + getVersion() + "\r\n");
19: result.append("code: " + getCode() + "\r\n");
20: result.append("message: " + getMessage() + "\r\n");
21: for (Map.Entry<String, String> e : getFields().entrySet())
22: result.append(e.getKey() + ": " + e.getValue() + "\r\n");
23: ((ExampleService) connection.element).print(result.toString());
24: super.header();
25: }
26: }
|