Package com.aelitis.azureus.core.networkmanager

Examples of com.aelitis.azureus.core.networkmanager.OutgoingMessageQueue


 
  protected void
  flushRequestsSupport(
    final flushListener    l )
  {
    OutgoingMessageQueue omq = getConnection().getOutgoingMessageQueue();
   
    final Message  http_message = new HTTPMessage( new byte[0] );
   
    omq.registerQueueListener(
      new OutgoingMessageQueue.MessageQueueListener()
      {
        public boolean
        messageAdded(
          Message message )
        { 
          return( true );
        }
          
        public void
        messageQueued(
          Message message )
        {     
        }
           
        public void
        messageRemoved(
          Message message )
        {
        }
           
        public void
        messageSent(
          Message message )
        {
          if ( message == http_message ){
           
            l.flushed();
          }
        }
           
          public void
          protocolBytesSent(
            int byte_count )
          { 
          }
        
          public void
          dataBytesSent(
            int byte_count )
          { 
          }
         
          public void flush(){}
      });
   
    omq.addMessage( http_message, false );
   
      // if after adding the message there's no bytes on the queue then we need to trigger an
      // immediate flushed event as the queue won't get processed (0 bytes on it...)
   
    if ( omq.getTotalSize() == 0 ){
     
      l.flushed();
    }
  }
View Full Code Here


    sendHave(
      int  piece_number )
    {
      BTHave message = new BTHave( piece_number, BTMessageFactory.MESSAGE_VERSION_INITIAL );
     
      OutgoingMessageQueue out_q = connection.getOutgoingMessageQueue();
     
      out_q.addMessage( message, false );
     
      out_q.flush();
    }
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.networkmanager.OutgoingMessageQueue

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.