Examples of HttpResponseHeader


Examples of org.xlightweb.HttpResponseHeader

     
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException {
             
              BodyDataSink ds = exchange.send(new HttpResponseHeader(200, "text/plain"), 10);
              ds.flush();
              ds.write("1234567890");
              ds.close();
            }           
        };  
View Full Code Here

Examples of org.xlightweb.HttpResponseHeader

     
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException {
             
              BodyDataSink ds = exchange.send(new HttpResponseHeader(200, "text/plain"));
              ds.write("1234567890");
              ds.close();
            }           
        };  
       
View Full Code Here

Examples of org.xlightweb.HttpResponseHeader

     
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException {
             
              BodyDataSink ds = exchange.send(new HttpResponseHeader(200, "text/plain"));
             
              for (int i = 0; i < 100; i++) {
                ds.write("1234567890");
              }
             
View Full Code Here

Examples of org.xlightweb.HttpResponseHeader

     
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException {
             
              BodyDataSink ds = exchange.send(new HttpResponseHeader(200, "text/plain"));
              ds.flush();
              ds.write("1234567890");
              ds.close();
            }           
        };  
View Full Code Here

Examples of org.xlightweb.HttpResponseHeader

     
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException {
             
              BodyDataSink ds = exchange.send(new HttpResponseHeader(200, "text/plain"));
              ds.setFlushmode(FlushMode.ASYNC);
             
              for (int i = 0; i < 100; i++) {
                ds.write("1234567890");
              }
View Full Code Here

Examples of org.xlightweb.HttpResponseHeader

     
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException {
             
              BodyDataSink ds = exchange.send(new HttpResponseHeader(200, "text/plain"));
              ds.setFlushmode(FlushMode.ASYNC);
              ds.setAutoflush(false);
             
              for (int i = 0; i < 100; i++) {
                ds.write("1234567890");
View Full Code Here

Examples of org.xlightweb.HttpResponseHeader

       
        if (request.getRequestURI().endsWith("/RegisterClient")) {
          BlockingBodyDataSource inChannel = request.getBlockingBody();
          inChannel.setReceiveTimeoutSec(1);
         
          BodyDataSink outChannel = exchange.send(new HttpResponseHeader(200, "text/plain"));
          outChannel.setFlushmode(FlushMode.ASYNC);
          outChannel.flush();
         
          register(new Link(outChannel, inChannel));
        } else {
View Full Code Here

Examples of org.xlightweb.HttpResponseHeader

    public void onRequest(IHttpExchange exchange) throws IOException {
     
      int loops = exchange.getRequest().getIntParameter("loops");
      int waittime = exchange.getRequest().getIntParameter("waittime");
     
      HttpResponseHeader header = new HttpResponseHeader(200, "text/plain");
      BodyDataSink bodyDataSink = exchange.send(header);
     
      for (int i = 0; i < loops; i++) {
        bodyDataSink.write("1234567890");
        QAUtil.sleep(waittime);
View Full Code Here

Examples of org.xlightweb.HttpResponseHeader

       
       
        public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
            int delay = exchange.getRequest().getIntParameter("delay", 0);
           
            BodyDataSink ds = exchange.send(new HttpResponseHeader(200, "text/plain; charset=ISO-8859-1"), 2);
            ds.flush();
            QAUtil.sleep(delay);
           
            ds.write("OK");
            ds.close();
View Full Code Here

Examples of org.xlightweb.HttpResponseHeader


    public void onRequest(IHttpExchange exchange) throws IOException {

      // send response
      HttpResponseHeader responseHeader = new HttpResponseHeader(200, "text/plain");

      IHttpRequest request = exchange.getRequest();
     
      BodyDataSink bodyDataSink = exchange.send(responseHeader);
      bodyDataSink.write("requestUri=" + request.getRequestURI() + "\r\n");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.