Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

socket_protobuf

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socket_protobuf - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

7

lib/client/Client.d.ts

@@ -33,10 +33,12 @@ import { ServerSocket } from "./ServerSocket";

private onConnectedCallback;
private onDisconnectedCallback;
constructor(host: Host);
private onConnected;
send(cmdId: number, newBuff: Uint8Array | Buffer): boolean;
private onMessage;
private onConnected;
private disconnected;
private onClose;
private onEnd;
private onError;
startConnect(onServerInfo: (server: PServer) => void, clientInfo?: PServer, onConnected?: () => void): void;
startConnect(onServerInfo: (server: PServer) => void, clientInfo?: PServer, onConnected?: () => void, onDisconnected?: () => void): void;
private start;

@@ -47,3 +49,2 @@ private doConnect;

private onTimeOut;
private onReconnect;
private clearTimeOut;

@@ -50,0 +51,0 @@ onGetServerInfo(server: PServer): void;

@@ -27,2 +27,11 @@ "use strict";

}
send(cmdId, newBuff) {
if (this._is_init_ok) {
return this.server.send(cmdId, newBuff);
}
return false;
}
async onMessage(buffer) {
await this.handlerMgr.handleBuffer(buffer);
}
onConnected() {

@@ -40,12 +49,9 @@ this._connect_stat = NetStatus.connected;

}
send(cmdId, newBuff) {
if (this._is_init_ok) {
return this.server.send(cmdId, newBuff);
disconnected() {
if (null != this.onDisconnectedCallback) {
this.onDisconnectedCallback();
}
return false;
}
async onMessage(buffer) {
await this.handlerMgr.handleBuffer(buffer);
}
onClose() {
this.disconnected();
this.lineLogErr("服务器---连接-对方关闭");

@@ -56,2 +62,3 @@ this.clearSocket();

onEnd() {
this.disconnected();
this.lineLogErr("服务器---连接-对方结束");

@@ -62,2 +69,3 @@ this.clearSocket();

onError() {
this.disconnected();
this.lineLogErr(this.lineInfo + " Sever服务器---连接错误");

@@ -67,3 +75,3 @@ this.clearSocket();

}
startConnect(onServerInfo, clientInfo = null, onConnected = null) {
startConnect(onServerInfo, clientInfo = null, onConnected = null, onDisconnected = null) {
this.onServerInfo = onServerInfo;

@@ -86,2 +94,3 @@ if (null == clientInfo) {

this.onConnectedCallback = onConnected;
this.onDisconnectedCallback = onDisconnected;
this.start();

@@ -125,5 +134,2 @@ }

this._connect_index++;
this.onReconnect();
}
onReconnect() {
console.warn(this.lineInfo + `-------!!!已达到${this._connect_index}次连接尝试....`);

@@ -130,0 +136,0 @@ this.start();

{
"name": "socket_protobuf",
"version": "1.1.7",
"version": "1.1.8",
"description": "socket发送protobuf二进制流的SDK",

@@ -5,0 +5,0 @@ "main": "App.js",

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