function EventHubClient(connString, path) {
  this.config = createConfig(connString, path);

  this.connectPromise = null;

  if (!this.config.eventHubName) {
    throw new Error('No event hub name specified');
  }

  var token = SharedAccessSignature.create(this.config.host, this.config.keyName, this.config.key, anHourFromNow()).toString();

  this.uri = 'amqps://' +
    encodeURIComponent(this.config.keyName + '@sas.root.' + this.config.namespace) + ':' +
    encodeURIComponent(token) + '@' +
    this.config.host;

  this.amqpClient = new amqp10.Client(amqp10.Policy.EventHub);
}
/**
 * @class EventHubClient
 * @classdesc Constructs a {@linkcode EventHubClient} object with the given connection string
 * @param {String}  connString    The EventHub connection string
 * @param {String}  path          The EventHub path. Optional.
 */
@class EventHubClient
@classdesc Constructs a  EventHubClient object with the given connection string
@param {String}  connString    The EventHub connection string
@param {String}  path          The EventHub path. Optional.
@class EventHubClient @classdesc Constructs a EventHubClient object with the given connection string @param { String } connString The EventHub connection string @param { String } path The EventHub path . Optional .
function EventHubClient(connString, path) {
  this.config = createConfig(connString, path);
  this.connectPromise = null;
  if (!this.config.eventHubName) {
    throw new Error('No event hub name specified');
  }
  var token = SharedAccessSignature.create(this.config.host, this.config.keyName, this.config.key, anHourFromNow()).toString();
  this.uri = 'amqps://' +
    encodeURIComponent(this.config.keyName + '@sas.root.' + this.config.namespace) + ':' +
    encodeURIComponent(token) + '@' +
    this.config.host;
  this.amqpClient = new amqp10.Client(amqp10.Policy.EventHub);
}
function EventHubClient ( connString , path ) { this . config = createConfig ( connString , path ) ; this . connectPromise = null ; if ( ! this . config . eventHubName ) { throw new Error ( 'No event hub name specified' ) ; } var token = SharedAccessSignature . create ( this . config . host , this . config . keyName , this . config . key , anHourFromNow ( ) ) . toString ( ) ; this . uri = 'amqps://' + encodeURIComponent ( this . config . keyName + '@sas.root.' + this . config . namespace ) + ':' + encodeURIComponent ( token ) + '@' + this . config . host ; this . amqpClient = new amqp10 . Client ( amqp10 . Policy . EventHub ) ; }
@class EventHubClient
 @classdesc Constructs a {@linkcode EventHubClient} object with the given connection string
 @param {String}  connString    The EventHub connection string
 @param {String}  path          The EventHub path.
@class EventHubClient @classdesc Constructs a { @linkcode EventHubClient } object with the given connection string @param { String } connString The EventHub connection string @param { String } path The EventHub path .