Examples of PooledByteBuffer


Examples of io.undertow.server.handlers.cache.LimitedBufferSlicePool.PooledByteBuffer

                return false;
            }

            PooledByteBuffer[] buffers = new PooledByteBuffer[n];
            for (int i = 0; i < n; i++) {
                PooledByteBuffer allocate = slicePool.allocate();
                if (allocate == null) {
                    while (--i >= 0) {
                        buffers[i].free();
                    }
View Full Code Here

Examples of io.undertow.server.handlers.cache.LimitedBufferSlicePool.PooledByteBuffer

                return false;
            }

            PooledByteBuffer[] buffers = new PooledByteBuffer[n];
            for (int i = 0; i < n; i++) {
                PooledByteBuffer allocate = slicePool.allocate();
                if (allocate == null) {
                    while (--i >= 0) {
                        buffers[i].free();
                    }
View Full Code Here

Examples of io.undertow.server.handlers.cache.LimitedBufferSlicePool.PooledByteBuffer

                return false;
            }

            PooledByteBuffer[] buffers = new PooledByteBuffer[n];
            for (int i = 0; i < n; i++) {
                PooledByteBuffer allocate = slicePool.allocate();
                if (allocate == null) {
                    while (--i >= 0) {
                        buffers[i].free();
                    }
View Full Code Here

Examples of io.undertow.server.handlers.cache.LimitedBufferSlicePool.PooledByteBuffer

                return false;
            }

            PooledByteBuffer[] buffers = new PooledByteBuffer[n];
            for (int i = 0; i < n; i++) {
                PooledByteBuffer allocate = slicePool.allocate();
                if (allocate == null) {
                    while (--i >= 0) {
                        buffers[i].free();
                    }
View Full Code Here

Examples of io.undertow.server.handlers.cache.LimitedBufferSlicePool.PooledByteBuffer

                return false;
            }

            PooledByteBuffer[] buffers = new PooledByteBuffer[n];
            for (int i = 0; i < n; i++) {
                PooledByteBuffer allocate = slicePool.allocate();
                if (allocate == null) {
                    while (--i >= 0) {
                        buffers[i].free();
                    }
View Full Code Here

Examples of io.undertow.server.handlers.cache.LimitedBufferSlicePool.PooledByteBuffer

                return false;
            }

            PooledByteBuffer[] buffers = new PooledByteBuffer[n];
            for (int i = 0; i < n; i++) {
                PooledByteBuffer allocate = slicePool.allocate();
                if (allocate == null) {
                    while (--i >= 0) {
                        buffers[i].free();
                    }
View Full Code Here

Examples of io.undertow.server.handlers.cache.LimitedBufferSlicePool.PooledByteBuffer

                return false;
            }

            PooledByteBuffer[] buffers = new PooledByteBuffer[n];
            for (int i = 0; i < n; i++) {
                PooledByteBuffer allocate = slicePool.allocate();
                if (allocate == null) {
                    while (--i >= 0) {
                        buffers[i].free();
                    }
View Full Code Here

Examples of org.gudy.azureus2.plugins.utils.PooledByteBuffer

  {
    boolean  handled = false;
   
    for (int i=0;i<listeners.size();i++){
     
      PooledByteBuffer  buffer = new PooledByteBufferImpl(message.getPayload());
     
      try{
        ((GenericMessageConnectionListener)listeners.get(i)).receive( this, buffer );
       
        handled = true;
       
      }catch( Throwable f ){
       
        buffer.returnToPool();
       
        if ( !( f instanceof MessageException )){
       
          Debug.printStackTrace(f);
        }
View Full Code Here

Examples of org.gudy.azureus2.plugins.utils.PooledByteBuffer

                   
                      throws MessageException
                    {
                      System.out.println( "receive: " + message.toByteArray().length );
                     
                      PooledByteBuffer  reply =
                        plugin_interface.getUtilities().allocatePooledByteBuffer(
                            new byte[connection.getMaximumMessageSize()]);
                     
                      connection.send( reply );
                    }
                   
                    public void
                    failed(
                      GenericMessageConnection  connection,
                      Throwable           error )
                   
                      throws MessageException
                    {
                      System.out.println( "Responder connection error:" );

                      error.printStackTrace();
                   
                  });
               
              }catch( Throwable e ){
               
                connection.close();
               
                e.printStackTrace();
              }
             
              return( true );
            }
          });
     
      InetSocketAddress  tcp_target = new InetSocketAddress( "127.0.0.1",     6889 );
      InetSocketAddress  udp_target = new InetSocketAddress( "212.159.18.92",   6881 );
     
      GenericMessageEndpoint  endpoint = reg.createEndpoint( tcp_target );
     
      endpoint.addTCP( tcp_target );
      endpoint.addUDP( udp_target );
     
      while( true ){
       
        try{
          for (int i=0;i<1000;i++){
           
            System.out.println( "Test: initiating connection" );
           
            final AESemaphore  sem = new AESemaphore( "wait!" );
           
            GenericMessageConnection  con = reg.createConnection( endpoint );
           
            if ( use_sts ){
             
              con = sec_man.getSTSConnection(
                con, my_key,
                new SEPublicKeyLocator()
                {
                  public boolean
                  accept(
                    Object      context,
                    SEPublicKey    other_key )
                  {
                    System.out.println( "acceptKey" );
                   
                    return( true );
                  }
                },
                "test", block_crypto );
            }
           
            con.addListener(
              new GenericMessageConnectionListener()
              {
                public void
                connected(
                  GenericMessageConnection  connection )
                {
                  System.out.println( "connected" );
                 
                  PooledByteBuffer  data = plugin_interface.getUtilities().allocatePooledByteBuffer( "1234".getBytes());
                 
                  try{
                    connection.send( data );
                   
                  }catch( Throwable e ){
View Full Code Here

Examples of org.gudy.azureus2.plugins.utils.PooledByteBuffer

     
      try{
        byte[]  plain  =  message.toByteArray();
        byte[]  enc    = outgoing_cipher.doFinal( plain );
     
        PooledByteBuffer  temp = new PooledByteBufferImpl( enc );
       
        try{
          connection.send( temp );
         
            // successfull send -> release caller's buffer
         
          message.returnToPool();
         
        }catch( Throwable e ){
         
            // failed semantics are to not release the caller's buffer
         
          temp.returnToPool();
         
          throw( e );
        }
       
      }catch( Throwable e ){
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.