예제 #1
0
  /** Called from NDNxServiceControl */
  @Override
  public void newNDNxStatus(SERVICE_STATUS st) {
    // NOw pass on the status to the app
    if (null != _chatCallback) {
      switch (st) {
        case START_ALL_DONE:
          try {
            // If we specified a remote host, use it not multicast
            if (null != _remotehost && _remotehost.length() > 0) {
              SimpleFaceControl.getInstance()
                  .connectTcp(_remotehost, Integer.parseInt(_remoteport));
            } else {
              SimpleFaceControl.getInstance().openMulicastInterface();
            }
            _chatCallback.ndnxServices(true);
          } catch (NDNDaemonException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            _chatCallback.ndnxServices(false);
          }

          break;
        case START_ALL_ERROR:
          _chatCallback.ndnxServices(false);
          break;
      }
    }
  }
예제 #2
0
 /** called from ndnChatNet when there's a new message. Pass it on to the UI. */
 @Override
 public void recvMessage(String message) {
   Log.d(TAG, "recv text = " + message);
   _chatCallback.recv(message);
 }