fix(core): update

This commit is contained in:
2022-12-28 13:52:16 +01:00
parent da39d52975
commit 7bbcc91300
10 changed files with 35 additions and 46 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartsocket',
version: '2.0.9',
version: '2.0.10',
description: 'easy and secure websocket communication'
}

View File

@ -61,7 +61,10 @@ export class Smartsocket {
await plugins.smartdelay.delayFor(1000);
this.socketConnections.forEach((socketObjectArg: SocketConnection) => {
if (socketObjectArg) {
logger.log('info', `disconnecting socket with >>alias ${socketObjectArg.alias} due to server stop...`);
logger.log(
'info',
`disconnecting socket with >>alias ${socketObjectArg.alias} due to server stop...`
);
socketObjectArg.disconnect();
}
});

View File

@ -161,11 +161,10 @@ export class SocketConnection {
this.socket.on('function', (dataArg: ISocketRequestDataObject<any>) => {
// check if requested function is available to the socket's scope
// logger.log('info', 'function request received');
const referencedFunction: SocketFunction<any> = this.smartsocketRef.socketFunctions.findSync(
(socketFunctionArg) => {
const referencedFunction: SocketFunction<any> =
this.smartsocketRef.socketFunctions.findSync((socketFunctionArg) => {
return socketFunctionArg.name === dataArg.funcCallData.funcName;
}
);
});
if (referencedFunction) {
// logger.log('ok', 'function in access scope');
const localSocketRequest = new SocketRequest(this.smartsocketRef, {
@ -197,7 +196,10 @@ export class SocketConnection {
this.remoteTagStoreObservable.next(tagStoreArg);
});
logger.log('info', `now listening to function requests for ${this.alias} on side ${this.side}`);
logger.log(
'info',
`now listening to function requests for ${this.alias} on side ${this.side}`
);
done.resolve(this);
} else {
const errMessage = 'socket needs to be authenticated first';

View File

@ -13,7 +13,7 @@ export class SocketServer {
private smartsocket: Smartsocket;
private httpServerDeferred: plugins.smartpromise.Deferred<any>;
private httpServer: pluginsTyped.http.Server | pluginsTyped.https.Server;
/**
* wether httpServer is standalone
*/

View File

@ -10,7 +10,7 @@ import type * as smartexpress from '@pushrocks/smartexpress';
export { smartexpress };
// third party scope
import type { Socket as ServerSocket, Server as ServerServer} from 'socket.io';
import type { Socket as ServerSocket, Server as ServerServer } from 'socket.io';
import type { Socket as ClientSocket, connect as ClientIo } from 'socket.io-client';
export namespace socketIo {