I have implemented the following code:
module.exports = { getDataFromUserGps: function(callback) { connection.connect(); connection.qu
inplace of connection.connect(); use -
connection.connect();
if(!connection._connectCalled ) { connection.connect(); }
if it is already called then connection._connectCalled =true, & it will not execute connection.connect();
connection._connectCalled =true
connection.connect()
note - don't use connection.end();
connection.end();