e.printStackTrace();
continue;
}
}
}
}
2、 当接收到请求之后,开启线程处理请求;
package http;
import java.io.InputStream;
import java.io.IOException;
public class Request {
private InputStream input;
private String uri;
public Request(InputStream input) {
new InputtoFilr().saveinFile();
this.input = input;
}
public void parse() {
// Read a set of characters from the socket
StringBuffer request = new StringBuffer(2048);
int i;
byte[] buffer = new byte[2048];
try {
i = input.read(buffer);