Package freenet.io.comm

Examples of freenet.io.comm.SlowAsyncMessageFilterCallback


       
        // Two stage timeout. Don't go fatal unless no response in 60 seconds.
        // Yes it's ugly everywhere but since we have a longish connection timeout it's necessary everywhere. :|
        // FIXME review two stage timeout everywhere with some low level networking guru.
        MessageFilter mf = makeDataInsertFilter(SECONDS.toMillis(60));
        node.usm.addAsyncFilter(mf, new SlowAsyncMessageFilterCallback() {

          @Override
          public void onMatched(Message m) {
            // Okay, great.
            // Either we got a DataInsert, in which case the transfer was aborted above, or we got a DataInsertRejected, which means it never started.
View Full Code Here


      MessageFilter.create().setSource(source).setField(DMT.UID, uid).
      setTimeout(RequestSender.OPENNET_TIMEOUT).setType(DMT.FNPOpennetCompletedTimeout);
   
    mf = mfAck.or(mfAckTimeout.or(mf));
    try {
      node.usm.addAsyncFilter(mf, new SlowAsyncMessageFilterCallback() {
       
        boolean completed;

        @Override
        public void onMatched(Message msg) {
View Full Code Here

    // The node didn't accept the request. So we don't need to send them the data.
    // However, we do need to wait a bit longer to try to postpone the fatalTimeout().
    // Somewhat intricate logic to try to avoid fatalTimeout() if at all possible.
    MessageFilter mf = makeAcceptedRejectedFilter(next, TIMEOUT_AFTER_ACCEPTEDREJECTED_TIMEOUT, tag);
    try {
      node.usm.addAsyncFilter(mf, new SlowAsyncMessageFilterCallback() {

        @Override
        public void onMatched(Message m) {
          if(m.getSpec() == DMT.FNPRejectedLoop ||
              m.getSpec() == DMT.FNPRejectedOverload) {
View Full Code Here

      // Wait asynchronously for a response.
    synchronized(this) {
      receivingAsync = true;
    }
    try {
      node.usm.addAsyncFilter(getOfferedKeyReplyFilter(pn, getOfferedTimeout), new SlowAsyncMessageFilterCallback() {
       
        @Override
        public void onMatched(Message m) {
          OFFER_STATUS status =
            isSSK ? handleSSKOfferReply(m, pn, offer) :
View Full Code Here

  }

  private OFFER_STATUS handleOfferTimeout(final BlockOffer offer, final PeerNode pn,
      OfferList offers) {
    try {
      node.usm.addAsyncFilter(getOfferedKeyReplyFilter(pn, GET_OFFER_LONG_TIMEOUT), new SlowAsyncMessageFilterCallback() {
       
        @Override
        public void onMatched(Message m) {
          OFFER_STATUS status =
            isSSK ? handleSSKOfferReply(m, pn, offer) :
View Full Code Here

    long timeout = MINUTES.toMillis(1);

    MessageFilter mf = makeAcceptedRejectedFilter(next, timeout, origTag);
    try {
      node.usm.addAsyncFilter(mf, new SlowAsyncMessageFilterCallback() {

        @Override
        public void onMatched(Message m) {
          if(m.getSpec() == DMT.FNPRejectedLoop ||
              m.getSpec() == DMT.FNPRejectedOverload) {
View Full Code Here

    // The node didn't accept the request. So we don't need to send them the data.
    // However, we do need to wait a bit longer to try to postpone the fatalTimeout().
    // Somewhat intricate logic to try to avoid fatalTimeout() if at all possible.
    MessageFilter mf = makeAcceptedRejectedFilter(next, TIMEOUT_AFTER_ACCEPTEDREJECTED_TIMEOUT, tag);
    try {
      node.usm.addAsyncFilter(mf, new SlowAsyncMessageFilterCallback() {

        @Override
        public void onMatched(Message m) {
          if(m.getSpec() == DMT.FNPRejectedLoop ||
              m.getSpec() == DMT.FNPRejectedOverload) {
View Full Code Here

TOP

Related Classes of freenet.io.comm.SlowAsyncMessageFilterCallback

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.