aotrautils-srv 0.0.324 → 0.0.325

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1_29072022-2359 (04/12/2022-13:37:57)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (04/12/2022-13:55:24)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4827,7 +4827,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4827
4827
 
4828
4828
 
4829
4829
 
4830
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (04/12/2022-13:37:57)»*/
4830
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (04/12/2022-13:55:24)»*/
4831
4831
  /*-----------------------------------------------------------------------------*/
4832
4832
 
4833
4833
 
@@ -5184,7 +5184,7 @@ WebsocketImplementation={
5184
5184
  clientPingIntervalMillis:5000,
5185
5185
  // clientsSockets:[],
5186
5186
  serverSocket:serverSocket,
5187
- receptionEntryPointsByClient:{},
5187
+ receptionEntryPoints:[],
5188
5188
 
5189
5189
  receive:(channelNameParam, doOnIncomingMessage, clientsRoomsTag=null)=>{
5190
5190
 
@@ -5242,10 +5242,11 @@ WebsocketImplementation={
5242
5242
  };
5243
5243
 
5244
5244
 
5245
- if(!nodeServerInstance.receptionEntryPointsByClient[clientId])
5246
- nodeServerInstance.receptionEntryPointsByClient[clientId]=[];
5247
- nodeServerInstance.receptionEntryPointsByClient[clientId].push(receptionEntryPoint);
5245
+ nodeServerInstance.receptionEntryPoints.push(receptionEntryPoint);
5246
+
5248
5247
 
5248
+ // // DBG
5249
+ // console.log("ADD RECEPTION ENTRY POINT channelName:«"+channelName+"»! nodeServerInstance.receptionEntryPoints.length:",nodeServerInstance.receptionEntryPoints.length);
5249
5250
 
5250
5251
 
5251
5252
  return nodeServerInstance;
@@ -5346,14 +5347,10 @@ WebsocketImplementation={
5346
5347
  const clientId=getUUID();
5347
5348
  clientSocket.clientId=clientId;
5348
5349
 
5349
-
5350
-
5351
5350
  const doOnMessage=(eventOrMessage)=>{
5352
5351
 
5353
5352
  // We execute the events registration listeners entry points:
5354
- if(!nodeServerInstance.receptionEntryPointsByClient[clientId])
5355
- return;
5356
- foreach(nodeServerInstance.receptionEntryPointsByClient[clientId],(receptionEntryPoint,i)=>{
5353
+ foreach(nodeServerInstance.receptionEntryPoints,(receptionEntryPoint,i)=>{
5357
5354
  receptionEntryPoint.execute(eventOrMessage, clientSocket, clientId);
5358
5355
  });
5359
5356
 
@@ -5380,9 +5377,8 @@ WebsocketImplementation={
5380
5377
 
5381
5378
  // On today, this method is named as same for the two implementations :
5382
5379
  // TRACE
5383
- lognow("(SERVER) Removing all listeners and receptjion entrypoints for client socket «"+clientSocket.clientId+"».");
5380
+ lognow("(SERVER) Removing all listeners for client socket «"+clientSocket.clientId+"».");
5384
5381
  clientSocket.removeAllListeners();
5385
- nodeServerInstance.receptionEntryPointsByClient[clientSocket.clientId]=[];
5386
5382
 
5387
5383
 
5388
5384
  // TODO : FIXME : Use one single interface !
@@ -5986,7 +5982,7 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
5986
5982
  }
5987
5983
 
5988
5984
 
5989
- initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OPTIONAL*/portParam, /*OPTIONAL*/certPathParam, /*OPTIONAL*/keyPathParam){
5985
+ initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OPTIONAL*/portParam, /*OPTIONAL*/certPathParam, /*OPTIONAL*/keyPathParam){
5990
5986
 
5991
5987
  // TRACE
5992
5988
  console.log("Server launched.");
@@ -6156,7 +6152,7 @@ initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OP
6156
6152
  // const REFRESH_SCREENSHOTS_MILLIS=500;
6157
6153
  //
6158
6154
  //
6159
- // const server=initNodeServer(
6155
+ // const server=initNodeServerInfrastructureWrapper(
6160
6156
  // // On each client connection :
6161
6157
  //// (serverParam, clientSocketParam)=>{},
6162
6158
  // null,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.324",
3
+ "version": "0.0.325",
4
4
  "main": "aotrautils-srv.build.js",
5
5
  "description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",