示例#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);
    }
  }
示例#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);
    }
  }
示例#3
0
  protected boolean sendTunnelMessage(DHTTransportContact target, Map data) {
    try {
      return (sendTunnelMessage(target, formatters.bEncode(data)));

    } catch (Throwable e) {

      log(e);

      return (false);
    }
  }