byte[] getSCPData() {
    byte[] data = new byte[1];
    if (connectionServices.isSupernode()) data[0] = PingRequest.SCP_ULTRAPEER;
    else data[0] = PingRequest.SCP_LEAF;

    if (networkManager.isIncomingTLSEnabled())
      data[0] |= PingRequest.SCP_TLS; // add our support for TLS.

    return data;
  }
 /**
  * @param l list to put the standard extentions we add to UDP pings
  * @return the guid to use for the ping
  */
 private GUID populateUDPGGEPList(List<NameValue<?>> l) {
   GUID guid;
   if (ConnectionSettings.EVER_ACCEPTED_INCOMING.getValue()) {
     guid = PingRequest.UDP_GUID;
   } else {
     l.add(new NameValue(GGEPKeys.GGEP_HEADER_IPPORT));
     guid = networkManager.getSolicitedGUID();
   }
   l.add(new NameValue<byte[]>(GGEPKeys.GGEP_HEADER_SUPPORT_CACHE_PONGS, getSCPData()));
   return guid;
 }
Пример #3
0
 public void initialize(TableLine line) {
   line.createEndpointHolder("127.0.0.1", networkManager.getPort(), false);
   line.setAddedOn(getCreationTime());
 }
Пример #4
0
 public String getHost() {
   return NetworkUtils.ip2string(networkManager.getAddress());
 }