raw-socket.xtp

来自「解压在c盘」· XTP 代码 · 共 43 行

XTP
43
字号
The additions are in com.caucho.server.http.Response and com.caucho.server.http.Request.  This will only work with bin/httpd.sh (or bin/httpd.exe on windows) and no filters.  The other configurations are not supported.Here's how it would work in a servlet:<example>import com.caucho.server.http.*;import com.caucho.vfs.*;public void service(HttpServletRequest request,                     HttpServlerResponse response)  throws IOException, ServletException{  Request req = (Request) request;  Response res = (Response) response;  // change to raw mode.  Resin will return a 101 response:  // HTTP/1.0 101 Switching Protocols  // Server: Resin/2.0  // Content-Type: text/html  // Content-Length: 0  // Date: Fri, 08 May 1998 09:51:31 GMT  //  // the raw data will appear immediately after the blank line  res.switchToRaw();  // you can use OutputStream instead of WriteStream.  It's  // automatically buffered  WriteStream os = res.getRawOutput();  // you can use InputStream instead of ReadStream.  ReadStream is = req.getRawInput();  // following code will use is and os as raw streams.}</example>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?