Comparing version 0.18.2 to 0.18.3
@@ -18,2 +18,3 @@ // Copyright 2013 SAP AG. | ||
var tls = require('tls'); | ||
var defaultKeepAliveIdle = 200000; // milliseconds | ||
@@ -36,3 +37,15 @@ exports.createSocket = net.connect; | ||
socket.setNoDelay(true); | ||
var keepAliveIdle = defaultKeepAliveIdle; | ||
var enableKeepAlive = true; | ||
if ('tcpKeepAliveIdle' in options) { | ||
var val = options['tcpKeepAliveIdle']; | ||
if (val === false) { | ||
enableKeepAlive = false; | ||
} else { | ||
keepAliveIdle = val * 1000; | ||
if (isNaN(keepAliveIdle)) keepAliveIdle = defaultKeepAliveIdle; | ||
} | ||
} | ||
socket.setKeepAlive(enableKeepAlive, keepAliveIdle); | ||
return socket; | ||
}; |
@@ -9,3 +9,3 @@ { | ||
"description": "SAP HANA Database Client for Node", | ||
"version": "0.18.2", | ||
"version": "0.18.3", | ||
"repository": { | ||
@@ -12,0 +12,0 @@ "type": "git", |
@@ -26,2 +26,3 @@ hdb - Pure JavaScript SAP HANA Database Client | ||
* [CESU-8 encoding support](#cesu-8-encoding-support) | ||
* [TCP Keepalive](#tcp-keepalive) | ||
* [Running tests](#running-tests) | ||
@@ -73,4 +74,4 @@ * [Running examples](#running-examples) | ||
| Pure JavaScript package |:x: |:heavy_check_mark:| | ||
| Node.js major version support |8, 10, 12|All Supported Versions| | ||
| License (without alternate SAP license agreement) |[SAP Developer Agreement](tools.hana.ondemand.com/developer-license.txt)|[Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)| | ||
| Node.js major version support |8+|All Supported Versions| | ||
| License (without alternate SAP license agreement) |[SAP Developer Agreement](https://tools.hana.ondemand.com/developer-license.txt)|[Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)| | ||
| SAP Support (with SAP Support agreement) |Component [HAN-DB-CLI](https://launchpad.support.sap.com/#incident/create)|Component [HAN-DB-CLI](https://launchpad.support.sap.com/#incident/create)| | ||
@@ -591,2 +592,34 @@ | Community Support |[answers.sap.com](https://answers.sap.com/tags/73554900100700000996) HANA tag|[node-hdb/issues](https://github.com/SAP/node-hdb/issues) | ||
TCP Keepalive | ||
------------- | ||
To configure TCP keepalive behaviour, include the tcpKeepAliveIdle connect option. The value provided for this option is the number of seconds before an idle connection will begin sending keepalive packets. By default, TCP keepalive will be turned on with a value of 200 seconds. If a value of 0 is specified, keepalive behaviour is determined by the operating system. | ||
The following example creates a client whose connections will begin sending keepalive packets after 300 seconds. | ||
```js | ||
var hdb = require('hdb'); | ||
var client = hdb.createClient({ | ||
host : 'hostname', | ||
port : 30015, | ||
user : 'user', | ||
password : 'secret', | ||
tcpKeepAliveIdle : 300 | ||
}); | ||
``` | ||
TCP keepalive can be explicity disabled by specifying tcpKeepAliveIdle=false as in the example below. | ||
```js | ||
var hdb = require('hdb'); | ||
var client = hdb.createClient({ | ||
host : 'hostname', | ||
port : 30015, | ||
user : 'user', | ||
password : 'secret', | ||
tcpKeepAliveIdle : false | ||
}); | ||
``` | ||
Running tests | ||
@@ -593,0 +626,0 @@ ------------- |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
294401
8140
668