Ejemplo n.º 1
0
  void startup(short protoVersionMajor, short protoVersionMinor, Map<String, Object> params)
      throws IOException {

    DataOutputStream out = beginMessage((char) 0);

    // Version
    out.writeShort(protoVersionMajor);
    out.writeShort(protoVersionMinor);

    // Name=Value pairs
    for (Map.Entry<String, Object> paramEntry : params.entrySet()) {
      out.writeCString(paramEntry.getKey());
      out.writeCString(paramEntry.getValue().toString());
    }

    endMessage((char) 0);
  }
Ejemplo n.º 2
0
  @Override
  public void authenticate(String response) throws IOException {

    DataOutputStream out = beginMessage();

    out.writeCString(response);

    endMessage(PASSWORD_MSG_ID);
  }