Package org.xlightweb

Examples of org.xlightweb.BodyDataSource


     
      // only POST is supported
      if (request.getMethod().equalsIgnoreCase("POST")) {
       
        if (request.getRequestURI().endsWith("/RegisterClient")) {
          BodyDataSource inChannel = request.getBody();
          inChannel.setReceiveTimeoutSec(1);
         
          BodyDataSink outChannel = exchange.send(new HttpResponseHeader(200, "text/plain"));
          outChannel.setFlushmode(FlushMode.ASYNC);
          outChannel.flush();
         
View Full Code Here


            dataSink.write("test");
           
            IHttpResponse response = respHdl.getResponse();
            Assert.assertEquals(200, response.getStatus());
           
            BodyDataSource dataSource = response.getBody();
            Assert.assertEquals("test", dataSource.readStringByLength(4));
           
            dataSink.write("12345");
            Assert.assertEquals("12345", dataSource.readStringByLength(5));
           
            dataSink.write("789");
            Assert.assertEquals("789", dataSource.readStringByLength(3));
           
            dataSink.close();
            con.close();   
           
            System.out.print(".");
View Full Code Here

TOP

Related Classes of org.xlightweb.BodyDataSource

Copyright © 2018 www.massapicom. 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.