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);
    }
  }