services/speech_to_text/v1.js
function connectIfNeeded() {
      // console.log('re-establishing the connect');
      websocket = null;
      socketCreationInProcess = false;

      // The token may have expired so test for it.
      getToken(determineService())
        .then(() => {
          return processSTTSocketStart(false);
        })
        .then(() => {
          //return Promise.resolve();
          return;
        })
        .catch((err) => {
          //return Promise.resolve();
          return;
        });
    }
function connectIfNeeded() {
      // console.log('re-establishing the connect');
      websocket = null;
      socketCreationInProcess = false;

      // The token may have expired so test for it.
      getToken(determineService())
        .then(() => {
          return processSTTSocketStart(false);
        })
        .then(() => {
          //return Promise.resolve();
          return;
        })
        .catch((err) => {
          //return Promise.resolve();
          return;
        });
    }
function connectIfNeeded ( ) { // console.log('re-establishing the connect'); websocket = null ; socketCreationInProcess = false ; // The token may have expired so test for it. getToken ( determineService ( ) ) . then ( ( ) => { return processSTTSocketStart ( false ) ; } ) . then ( ( ) => { //return Promise.resolve(); return ; } ) . catch ( ( err ) => { //return Promise.resolve(); return ; } ) ; }
If we are going to connect to STT through websockets then its going to disconnect or timeout, so need to handle that occurrence.
If we are going to connect to STT through websockets then its going to disconnect or timeout so need to handle that occurrence .