Menu

#411 Implement a connection timeout feature

open
nobody
None
5
2013-02-19
2013-02-19
Jira Trac
No

As of node-cubrid 1.1.1 when trying to connect to a server which is down (intentionally), a connect event is never fired, meaning it never fails when trying to connect to a database which is down.

There must be a configurable parameter with a default timeout value which should fire an error event with a message of connection being timed out.

{code}
var CUBRID = require('node-cubrid');

var conn = CUBRID.createCUBRIDConnection('10.11.12.13', 33000, 'dba', '', 'cubrid_cloud');

conn.connect(function (err) {
if (err) {
console.log(err);
}
else{
console.log('connection established');

conn.close(function () {
console.log('connection closed');
});
}
});
{code}

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.