Package org.xsocket.connection

Examples of org.xsocket.connection.IDataHandler



  @Test
  public void testSendingBody() throws Exception {
     
      IDataHandler dh = new IDataHandler() {

          private int state = 0;
         
            public boolean onData(INonBlockingConnection connection) throws IOException {
               
View Full Code Here


   
   
  @Test
  public void testSimple() throws Exception {
   
      IDataHandler dh = new IDataHandler() {
       
          public boolean onData(INonBlockingConnection connection) throws IOException {
              connection.readStringByDelimiter("\r\n\r\n");
             
              connection.write("HTTP/1.0 200 FOUND\r\n" +
View Full Code Here

 

    @Test
    public void testIllegal10ResponseTimeout() throws Exception {
       
        IDataHandler dh = new IDataHandler() {
         
            public boolean onData(INonBlockingConnection connection) throws IOException {
                connection.readStringByDelimiter("\r\n\r\n");
               
                connection.write("HTTP/1.0 200 FOUND\r\n" +
View Full Code Here

 

  @Test
  public void testBodyWithAdditionalBytes() throws Exception {
   
    IDataHandler dh = new IDataHandler() {
     
      public boolean onData(INonBlockingConnection connection) throws IOException, BufferUnderflowException, ClosedChannelException, MaxReadSizeExceededException {
        connection.readStringByDelimiter("\r\n\r\n");
       
        connection.write("HTTP/1.1 200 OK\r\n" +
View Full Code Here

 

  @Test
  public void testNoInterceptors() throws Exception {
     
      IDataHandler dh = new IDataHandler() {
         
          public boolean onData(INonBlockingConnection connection) throws IOException, BufferUnderflowException, ClosedChannelException, MaxReadSizeExceededException {
         
              connection.readStringByDelimiter("\r\n\r\n");
             
View Full Code Here

 
 
    @Test
    public void testSimple() throws Exception {
       
        IDataHandler dh = new IDataHandler() {
           
            public boolean onData(INonBlockingConnection connection) throws IOException, BufferUnderflowException, ClosedChannelException, MaxReadSizeExceededException {
           
                connection.readStringByDelimiter("\r\n\r\n");
               
View Full Code Here

 
   
    @Test
    public void testCustomInterceptor() throws Exception {
       
        IDataHandler dh = new IDataHandler() {
           
            public boolean onData(INonBlockingConnection connection) throws IOException, BufferUnderflowException, ClosedChannelException, MaxReadSizeExceededException {
           
                connection.readStringByDelimiter("\r\n\r\n");
               
View Full Code Here


  @Test
  public void testMultithreaded() throws Exception {

      IDataHandler dh = new IDataHandler() {
         
          public boolean onData(INonBlockingConnection connection) throws IOException, BufferUnderflowException, ClosedChannelException, MaxReadSizeExceededException {
              connection.readStringByDelimiter("\r\n\r\n");
              connection.write("HTTP/1.1 200 OK\r\n" +
                               "Content-Length: 5\r\n" +
View Full Code Here

 
 
  @Test
    public void testMultithreadedException() throws Exception {
       
        IDataHandler dh = new IDataHandler() {
           
            public boolean onData(INonBlockingConnection connection) throws IOException, BufferUnderflowException, ClosedChannelException, MaxReadSizeExceededException {
                connection.readStringByDelimiter("\r\n\r\n");
                connection.write("HTTP/1.1 200 OK\r\n" +
                                 "Conte");
View Full Code Here

   
 
  @Test
    public void testMultithreadedTimoutException() throws Exception {
       
        IDataHandler dh = new IDataHandler() {
           
            public boolean onData(INonBlockingConnection connection) throws IOException, BufferUnderflowException, ClosedChannelException, MaxReadSizeExceededException {
                // do nothing
                return false;
            }
View Full Code Here

TOP

Related Classes of org.xsocket.connection.IDataHandler

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.