tigerbeetle-node 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tigerbeetle-node",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "TigerBeetle Node.js client",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -164,7 +164,6 @@ fn MessageBusImpl(comptime process_type: ProcessType) type {
164
164
  }
165
165
  }.set;
166
166
 
167
- // Set tcp recv buffer size
168
167
  if (config.tcp_rcvbuf > 0) rcvbuf: {
169
168
  if (is_linux) {
170
169
  // Requires CAP_NET_ADMIN privilege (settle for SO_RCVBUF in case of an EPERM):
@@ -178,7 +177,6 @@ fn MessageBusImpl(comptime process_type: ProcessType) type {
178
177
  try set(fd, os.SOL.SOCKET, os.SO.RCVBUF, config.tcp_rcvbuf);
179
178
  }
180
179
 
181
- // Set tcp send buffer size
182
180
  if (config.tcp_sndbuf > 0) sndbuf: {
183
181
  if (is_linux) {
184
182
  // Requires CAP_NET_ADMIN privilege (settle for SO_SNDBUF in case of an EPERM):
@@ -192,30 +190,26 @@ fn MessageBusImpl(comptime process_type: ProcessType) type {
192
190
  try set(fd, os.SOL.SOCKET, os.SO.SNDBUF, config.tcp_sndbuf);
193
191
  }
194
192
 
195
- // Set tcp keep alive
196
193
  if (config.tcp_keepalive) {
197
194
  try set(fd, os.SOL.SOCKET, os.SO.KEEPALIVE, 1);
198
195
  if (is_linux) {
199
- try set(fd, os.IPPROTO.TCP, os.TCP_KEEPIDLE, config.tcp_keepidle);
200
- try set(fd, os.IPPROTO.TCP, os.TCP_KEEPINTVL, config.tcp_keepintvl);
201
- try set(fd, os.IPPROTO.TCP, os.TCP_KEEPCNT, config.tcp_keepcnt);
196
+ try set(fd, os.IPPROTO.TCP, os.TCP.KEEPIDLE, config.tcp_keepidle);
197
+ try set(fd, os.IPPROTO.TCP, os.TCP.KEEPINTVL, config.tcp_keepintvl);
198
+ try set(fd, os.IPPROTO.TCP, os.TCP.KEEPCNT, config.tcp_keepcnt);
202
199
  }
203
200
  }
204
201
 
205
- // Set tcp user timeout
206
202
  if (config.tcp_user_timeout > 0) {
207
203
  if (is_linux) {
208
- try set(fd, os.IPPROTO.TCP, os.TCP_USER_TIMEOUT, config.tcp_user_timeout);
204
+ try set(fd, os.IPPROTO.TCP, os.TCP.USER_TIMEOUT, config.tcp_user_timeout);
209
205
  }
210
206
  }
211
207
 
212
208
  // Set tcp no-delay
213
209
  if (config.tcp_nodelay) {
214
- // TODO: use the version in the zig standard library when upgrading to 0.9
215
- // https://github.com/rust-lang/libc/search?q=TCP_NODELAY
216
- // https://github.com/ziglang/zig/search?q=TCP_NODELAY
217
- const TCP_NODELAY: u32 = 1;
218
- try set(fd, os.IPPROTO.TCP, TCP_NODELAY, 1);
210
+ if (is_linux) {
211
+ try set(fd, os.IPPROTO.TCP, os.TCP.NODELAY, 1);
212
+ }
219
213
  }
220
214
 
221
215
  try set(fd, os.SOL.SOCKET, os.SO.REUSEADDR, 1);