Package net.tomp2p.relay.android

Examples of net.tomp2p.relay.android.AndroidRelayConnection


    switch (relayType) {
      case OPENTCP:
        connection = new OpenTCPRelayConnection(peerConnection, peer, config);
        break;
      case ANDROID:
        connection = new AndroidRelayConnection(relayAddress, relayRPC, peer, config, credentials);
        break;
      default:
        LOG.error("Unknown relay type {}", relayType);
        return;
    }
View Full Code Here


            @Override
            public void bufferFull(List<Message> messageBuffer) {
              for (BaseRelayConnection connection : unreachablePeer.currentRelays()) {
                if (connection instanceof AndroidRelayConnection) {
                  final AndroidRelayConnection androidConnection = (AndroidRelayConnection) connection;
                  if(androidConnection.relayAddress().peerId().equals(forwarderRPC.relayPeerId())) {
                    // start in a new thread
                    new Thread(new Runnable() {
                      @Override
                      public void run() {
                        System.err.println("Caught sending message over GCM from " + forwarderRPC.relayPeerId() + " to unreachable peer");
                        try {
                          Thread.sleep(GCM_MOCK_DELAY_MS);
                        } catch (InterruptedException e) {
                          // ignore
                        }
                        androidConnection.sendBufferRequest();
                      }
                    }, "GCM-Mock").start();
                  }
                }
              }
View Full Code Here

TOP

Related Classes of net.tomp2p.relay.android.AndroidRelayConnection

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.