Package com.aelitis.azureus.core.networkmanager.impl

Examples of com.aelitis.azureus.core.networkmanager.impl.RawMessageImpl


   
    if ( message.isAlreadyEncoded()){
     
      return(
        new RawMessage[]{
          new RawMessageImpl(
            message,
            new DirectByteBuffer[]{ payload },
            RawMessage.PRIORITY_NORMAL,
            true,  // send immediately
            new Message[0] )});
     
    }else{
     
      DirectByteBuffer   header = DirectByteBufferPool.getBuffer( DirectByteBuffer.AL_EXTERNAL, 4 );
     
      header.putInt( DirectByteBuffer.SS_MSG, payload.remaining( DirectByteBuffer.SS_MSG ));
     
      header.flip( DirectByteBuffer.SS_MSG );
     
      return(
        new RawMessage[]{
          new RawMessageImpl(
            message,
            new DirectByteBuffer[]{ header, payload },
            RawMessage.PRIORITY_NORMAL,
            true,  // send immediately
            new Message[0] )});
View Full Code Here


    raw_buffs[0] = header;
    for( int i=0; i < payload.length; i++ ) {
      raw_buffs[i+1] = payload[i];
    }
   
    return new RawMessageImpl( base_message, raw_buffs, ld.priority, ld.is_no_delay, ld.to_remove );
  }
View Full Code Here

          ((requestListener)it.next()).requestComplete( req );
        }
      }
     
      raw_messages[i] =
        new RawMessageImpl(
            this_piece,
            buffers,
            RawMessage.PRIORITY_HIGH,
            true,
            new Message[0] );
View Full Code Here

  protected RawMessage
  getEmptyRawMessage(
    Message  message )
  {   
    return(
      new RawMessageImpl(
          message,
          new DirectByteBuffer[]{ new DirectByteBuffer( ByteBuffer.allocate(0))},
          RawMessage.PRIORITY_HIGH,
          true,
          new Message[0] ));
View Full Code Here

    String message_id = base_message.getID();
   
    LegacyData ld = (LegacyData)legacy_data.get( message_id )//determine if a legacy BT message
   
    if( ld != null ) {  //legacy message, use pre-configured values
      return new RawMessageImpl( base_message, raw_buffs, ld.priority, ld.is_no_delay, ld.to_remove );
    }
   
      // these should really be properties of the message...
   
    int   priority;
    boolean  no_delay  = true;
   
    if ( message_id == AZMessage.ID_AZ_HANDSHAKE ){
     
        // handshake needs to go out first - if not high then bitfield can get in front of it...
     
      priority = RawMessage.PRIORITY_HIGH;
     
    }else if ( message_id == AZMessage.ID_AZ_HAVE ){
     
      priority   = RawMessage.PRIORITY_LOW;
      no_delay  = false;
     
    }else{
     
         //standard message, ensure that protocol messages have wire priority over data payload messages

      priority = base_message.getType() == Message.TYPE_DATA_PAYLOAD ? RawMessage.PRIORITY_LOW : RawMessage.PRIORITY_NORMAL;
    }
       
    return new RawMessageImpl( base_message, raw_buffs, priority, no_delay, null );
  }
View Full Code Here

  protected RawMessage
  encode(
    Message message )
  {
    return(
        new RawMessageImpl(
            message,
            data,
            RawMessage.PRIORITY_HIGH,
            true,
            new Message[0] ));
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.networkmanager.impl.RawMessageImpl

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.