fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartsocket',
|
||||
version: '2.0.9',
|
||||
version: '2.0.10',
|
||||
description: 'easy and secure websocket communication'
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
@ -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';
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user