aotrautils-srv 0.0.323 → 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-02:54:45)»*/
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-02:54:45)»*/
4830
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (04/12/2022-13:55:24)»*/
4831
4831
  /*-----------------------------------------------------------------------------*/
4832
4832
 
4833
4833
 
@@ -5192,10 +5192,11 @@ WebsocketImplementation={
5192
5192
  lognow("(SERVER) Registering receive for «"+channelNameParam+"»...",doOnIncomingMessage);
5193
5193
 
5194
5194
 
5195
+
5195
5196
  const receptionEntryPoint={
5196
5197
  channelName:channelNameParam,
5197
5198
  clientsRoomsTag:clientsRoomsTag,
5198
- execute:(eventOrMessage, clientSocketParam)=>{
5199
+ execute:(eventOrMessage, clientSocketParam, clientId)=>{
5199
5200
 
5200
5201
  // With «ws» library we have no choive than register message events inside a «connection» event !
5201
5202
 
@@ -5343,20 +5344,14 @@ WebsocketImplementation={
5343
5344
  // if(contains(nodeServerInstance.clientsSockets, clientSocket)) return;
5344
5345
  // nodeServerInstance.clientsSockets.push(clientSocket);
5345
5346
 
5346
-
5347
- // DBG
5348
- clientSocket.clientId=getUUID();
5349
-
5350
-
5351
- // // DBG
5352
- // console.log("nodeServerInstance.receptionEntryPoints.length:",nodeServerInstance.receptionEntryPoints.length);
5353
-
5347
+ const clientId=getUUID();
5348
+ clientSocket.clientId=clientId;
5354
5349
 
5355
5350
  const doOnMessage=(eventOrMessage)=>{
5356
5351
 
5357
5352
  // We execute the events registration listeners entry points:
5358
5353
  foreach(nodeServerInstance.receptionEntryPoints,(receptionEntryPoint,i)=>{
5359
- receptionEntryPoint.execute(eventOrMessage, clientSocket);
5354
+ receptionEntryPoint.execute(eventOrMessage, clientSocket, clientId);
5360
5355
  });
5361
5356
 
5362
5357
  };
@@ -5381,6 +5376,8 @@ WebsocketImplementation={
5381
5376
 
5382
5377
 
5383
5378
  // On today, this method is named as same for the two implementations :
5379
+ // TRACE
5380
+ lognow("(SERVER) Removing all listeners for client socket «"+clientSocket.clientId+"».");
5384
5381
  clientSocket.removeAllListeners();
5385
5382
 
5386
5383
 
@@ -5985,7 +5982,7 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
5985
5982
  }
5986
5983
 
5987
5984
 
5988
- 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){
5989
5986
 
5990
5987
  // TRACE
5991
5988
  console.log("Server launched.");
@@ -6155,7 +6152,7 @@ initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OP
6155
6152
  // const REFRESH_SCREENSHOTS_MILLIS=500;
6156
6153
  //
6157
6154
  //
6158
- // const server=initNodeServer(
6155
+ // const server=initNodeServerInfrastructureWrapper(
6159
6156
  // // On each client connection :
6160
6157
  //// (serverParam, clientSocketParam)=>{},
6161
6158
  // null,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.323",
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)",