How to use the buttplug.ButtplugClientConnectorException function in buttplug

To help you get started, we’ve selected a few buttplug examples, based on popular ways it is used in public projects.

github buttplugio / buttplug-js / packages / buttplug-node-websockets / src / ButtplugNodeWebsocketClientConnector.ts View on Github external
public Send = async (aMsg: ButtplugMessage): Promise<ButtplugMessage> => {
    if (!this.Connected) {
      throw new ButtplugClientConnectorException("ButtplugClient not connected");
    }
    const p = this._sorter.PrepareOutgoingMessage(aMsg);
    this.wsClient!.send("[" + aMsg.toJSON() + "]");
    return await p;
  }