send(topic, data) {
    if (this.socket === null) {
      return Long.NEG_ONE;
    }

    this.lastMessageId = this.lastMessageId.add(1);

    const payload = Object.assign({ messageId: this.lastMessageId }, data);
    const type = this.protoroot.lookupType(topic);
    const buffer = type.encode(type.create(payload)).finish();

    // DO NOT AWAIT: bufferSend is built to bufferize payloads to be sent, and
    // it makes sure that they are sent in order and serially (0mq publisher
    // sockets can only send 1 message at a time, otherwise it throws with a
    // EAGAIN error)
    // Awaiting this method has no practical use. If you DO want to await it
    // (don't), then you have to first make a local copy of this.lastMessageId
    // to make sure that the value returned to the caller has not been
    // increased by other calls
    this.bufferSend(topic, buffer);

    return this.lastMessageId;
  }
Broadcasts a sync message. Topic must match a protobuf type name.
Returns immediately, but the message to be sent migh be bufferized and send
later.

@param  {String} topic name
@param  {Object} data
@returns {Long} ID of the message sent
@throws If the topic's protobuf type cannot be found