New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ferrum-db-client

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ferrum-db-client - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

18

dist/client.js

@@ -7,3 +7,3 @@ "use strict";

const utils_1 = require("./utils");
const MAX_BUFFER_SIZE = 128 * 1024 * 1024;
const MAX_BUFFER_SIZE = 512 * 1024 * 1024;
class FerrumServerClient {

@@ -52,3 +52,3 @@ constructor(socket) {

const toRead = Math.min(data.length - readOffset, msgRemaining);
if (toRead + writeOffset > msgBuffer.length) {
while (toRead + writeOffset > msgBuffer.length) {
msgBuffer = this.expandBuffer(msgBuffer, MAX_BUFFER_SIZE);

@@ -88,3 +88,2 @@ }

}
this.socket.connect(this.port, this.ip);
for (const pendingId of this.pending.keys()) {

@@ -97,2 +96,5 @@ const pending = this.pending.get(pendingId);

}
this.socket.connect(this.port, this.ip, () => {
this.lastResponse = Date.now();
});
}

@@ -106,4 +108,4 @@ disconnect() {

async heartbeat() {
if (Date.now() - this.lastResponse > 6000) {
this.socket.destroy();
if (Date.now() - this.lastResponse > 12000) {
this.socket.destroy(new Error('Heartbeat timeout'));
return;

@@ -160,4 +162,8 @@ }

getResponse(myId) {
return new Promise((resolve) => {
return new Promise((resolve, reject) => {
const timeout = setTimeout(() => {
reject(new Error('Timeout waiting for database response'));
}, 90000);
this.pending.set(myId, (buffer) => {
clearTimeout(timeout);
resolve(buffer);

@@ -164,0 +170,0 @@ });

{
"name": "ferrum-db-client",
"version": "0.2.3",
"version": "0.2.4",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts",

@@ -6,3 +6,3 @@ import { BinaryWriter, Encoding } from 'csharp-binary-stream';

const MAX_BUFFER_SIZE = 128 * 1024 * 1024;
const MAX_BUFFER_SIZE = 512 * 1024 * 1024;

@@ -63,3 +63,3 @@ export class FerrumServerClient {

const toRead = Math.min(data.length - readOffset, msgRemaining);
if (toRead + writeOffset > msgBuffer.length) {
while (toRead + writeOffset > msgBuffer.length) {
msgBuffer = this.expandBuffer(msgBuffer, MAX_BUFFER_SIZE);

@@ -104,3 +104,2 @@ }

this.socket.connect(this.port, this.ip);
for (const pendingId of this.pending.keys()) {

@@ -113,2 +112,5 @@ const pending = this.pending.get(pendingId);

}
this.socket.connect(this.port, this.ip, () => {
this.lastResponse = Date.now();
});
}

@@ -124,4 +126,4 @@

public async heartbeat(): Promise<void> {
if (Date.now() - this.lastResponse > 6000) {
this.socket.destroy();
if (Date.now() - this.lastResponse > 12000) {
this.socket.destroy(new Error('Heartbeat timeout'));
return;

@@ -188,4 +190,9 @@ }

public getResponse(myId: number): Promise<Buffer> {
return new Promise((resolve) => {
return new Promise((resolve, reject) => {
const timeout = setTimeout(() => {
reject(new Error('Timeout waiting for database response'));
}, 90000);
this.pending.set(myId, (buffer) => {
clearTimeout(timeout);
resolve(buffer);

@@ -192,0 +199,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc