Skip to content

Commit

Permalink
TCP keepalive for ILP socket (#17)
Browse files Browse the repository at this point in the history
* adding TCP keepalive

* adding TCP keepalive

* version bump
  • Loading branch information
glasstiger authored May 18, 2023
1 parent 83c7b19 commit c88ddd1
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 21 deletions.
24 changes: 12 additions & 12 deletions docs/Sender.html
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line355">line 355</a>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line356">line 356</a>
</li></ul></dd>


Expand Down Expand Up @@ -416,7 +416,7 @@ <h4 class="name" id="atNow"><span class="type-signature"></span>atNow<span class

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line374">line 374</a>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line375">line 375</a>
</li></ul></dd>


Expand Down Expand Up @@ -576,7 +576,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line286">line 286</a>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line287">line 287</a>
</li></ul></dd>


Expand Down Expand Up @@ -687,7 +687,7 @@ <h4 class="name" id="close"><span class="type-signature">(async) </span>close<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line166">line 166</a>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line167">line 167</a>
</li></ul></dd>


Expand Down Expand Up @@ -1064,7 +1064,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line301">line 301</a>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line302">line 302</a>
</li></ul></dd>


Expand Down Expand Up @@ -1175,7 +1175,7 @@ <h4 class="name" id="flush"><span class="type-signature">(async) </span>flush<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line179">line 179</a>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line180">line 180</a>
</li></ul></dd>


Expand Down Expand Up @@ -1357,7 +1357,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line317">line 317</a>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line318">line 318</a>
</li></ul></dd>


Expand Down Expand Up @@ -1789,7 +1789,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line269">line 269</a>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line270">line 270</a>
</li></ul></dd>


Expand Down Expand Up @@ -1971,7 +1971,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line244">line 244</a>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line245">line 245</a>
</li></ul></dd>


Expand Down Expand Up @@ -2130,7 +2130,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line223">line 223</a>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line224">line 224</a>
</li></ul></dd>


Expand Down Expand Up @@ -2312,7 +2312,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line337">line 337</a>
<a href="src_sender.js.html">src/sender.js</a>, <a href="src_sender.js.html#line338">line 338</a>
</li></ul></dd>


Expand Down Expand Up @@ -2386,7 +2386,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-@q
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Wed Jan 04 2023 19:03:57 GMT+0000 (Greenwich Mean Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Wed May 17 2023 18:51:54 GMT+0100 (British Summer Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-@q
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Wed Jan 04 2023 19:03:57 GMT+0000 (Greenwich Mean Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Wed May 17 2023 18:51:54 GMT+0100 (British Summer Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-@q
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Wed Jan 04 2023 19:03:57 GMT+0000 (Greenwich Mean Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Wed May 17 2023 18:51:54 GMT+0100 (British Summer Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-@questdb_nodejs-client.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-@q
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Wed Jan 04 2023 19:03:57 GMT+0000 (Greenwich Mean Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Wed May 17 2023 18:51:54 GMT+0100 (British Summer Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
3 changes: 2 additions & 1 deletion docs/src_sender.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ <h1 class="page-title">Source: src/sender.js</h1>
await self.close();
}
});
this.socket.setKeepAlive(true);

this.socket.on("data", async raw => {
data = !data ? raw : Buffer.concat([data, raw]);
Expand Down Expand Up @@ -539,7 +540,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-@q
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Wed Jan 04 2023 19:03:57 GMT+0000 (Greenwich Mean Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Wed May 17 2023 18:51:54 GMT+0100 (British Summer Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@questdb/nodejs-client",
"version": "1.0.2",
"version": "1.0.3",
"description": "QuestDB Node.js Client",
"main": "index.js",
"types": "types/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class Sender {
await self.close();
}
});
this.socket.setKeepAlive(true);

this.socket.on("data", async raw => {
data = !data ? raw : Buffer.concat([data, raw]);
Expand Down
8 changes: 7 additions & 1 deletion test/sender.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,12 @@ describe("Sender tests with containerized QuestDB instance", () => {
container = await new GenericContainer("questdb/questdb")
.withExposedPorts(QUESTDB_HTTP_PORT, QUESTDB_ILP_PORT)
.start();

const stream = await container.logs();
stream
.on("data", line => console.log(line))
.on("err", line => console.error(line))
.on("end", () => console.log("Stream closed"));
});

afterAll(async () => {
Expand All @@ -572,7 +578,7 @@ describe("Sender tests with containerized QuestDB instance", () => {

// create table
let createTableResult = await query(container,
`CREATE TABLE ${tableName}(${getFieldsString(schema)}) TIMESTAMP (timestamp) PARTITION BY DAY`
`CREATE TABLE ${tableName}(${getFieldsString(schema)}) TIMESTAMP (timestamp) PARTITION BY DAY BYPASS WAL`
);
expect(createTableResult.ddl).toBe("OK");

Expand Down
2 changes: 1 addition & 1 deletion types/src/sender.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c88ddd1

Please sign in to comment.