Beispiel #1
0
  protected Map sendRequest(DHTTransportContact target, Map data, int timeout) {
    try {
      byte[] res = sendRequest(target, formatters.bEncode(data), timeout);

      if (res == null) {

        return (null);
      }

      return (formatters.bDecode(res));

    } catch (Throwable e) {

      log(e);

      return (null);
    }
  }
Beispiel #2
0
  protected byte[] receiveRequest(DHTTransportUDPContact originator, byte[] data) {
    try {
      Map res = receiveRequest(originator, formatters.bDecode(data));

      if (res == null) {

        return (null);
      }

      return (formatters.bEncode(res));

    } catch (Throwable e) {

      log(e);

      return (null);
    }
  }
Beispiel #3
0
  protected boolean sendTunnelMessage(DHTTransportContact target, Map data) {
    try {
      return (sendTunnelMessage(target, formatters.bEncode(data)));

    } catch (Throwable e) {

      log(e);

      return (false);
    }
  }