aotrautils-srv 0.0.321 → 0.0.323

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-01:02:50)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (04/12/2022-02:54:45)»*/
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-01:02:50)»*/
4830
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (04/12/2022-02:54:45)»*/
4831
4831
  /*-----------------------------------------------------------------------------*/
4832
4832
 
4833
4833
 
@@ -5186,14 +5186,14 @@ WebsocketImplementation={
5186
5186
  serverSocket:serverSocket,
5187
5187
  receptionEntryPoints:[],
5188
5188
 
5189
- receive:(channelName, doOnIncomingMessage, clientsRoomsTag=null)=>{
5189
+ receive:(channelNameParam, doOnIncomingMessage, clientsRoomsTag=null)=>{
5190
5190
 
5191
5191
  // DBG
5192
- lognow("(SERVER) Registering receive for «"+channelName+"»...",doOnIncomingMessage);
5192
+ lognow("(SERVER) Registering receive for «"+channelNameParam+"»...",doOnIncomingMessage);
5193
5193
 
5194
5194
 
5195
5195
  const receptionEntryPoint={
5196
- channelName:channelName,
5196
+ channelName:channelNameParam,
5197
5197
  clientsRoomsTag:clientsRoomsTag,
5198
5198
  execute:(eventOrMessage, clientSocketParam)=>{
5199
5199
 
@@ -5219,7 +5219,7 @@ WebsocketImplementation={
5219
5219
 
5220
5220
 
5221
5221
  // DBG
5222
- lognow("(SERVER) ENTRY POINT IS OF THE RIGHT CHANNEL:", channelName);
5222
+ lognow("(SERVER) ENTRY POINT IS OF THE RIGHT CHANNEL:", receptionEntryPoint.channelName);
5223
5223
 
5224
5224
 
5225
5225
 
@@ -5379,7 +5379,11 @@ WebsocketImplementation={
5379
5379
 
5380
5380
  if (clientSocket.isConnectionAlive===false){
5381
5381
 
5382
- // TODO : FIXME : DUPLICATED CODE :
5382
+
5383
+ // On today, this method is named as same for the two implementations :
5384
+ clientSocket.removeAllListeners();
5385
+
5386
+
5383
5387
  // TODO : FIXME : Use one single interface !
5384
5388
  if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.terminate();
5385
5389
  else clientSocket.emit("endConnection");
@@ -5536,10 +5540,10 @@ WebsocketImplementation={
5536
5540
 
5537
5541
  receptionEntryPoints:[],
5538
5542
 
5539
- receive:(channelName, doOnIncomingMessage, clientsRoomsTag=null)=>{
5543
+ receive:(channelNameParam, doOnIncomingMessage, clientsRoomsTag=null)=>{
5540
5544
 
5541
5545
  const receptionEntryPoint={
5542
- channelName:channelName,
5546
+ channelName:channelNameParam,
5543
5547
  clientsRoomsTag:clientsRoomsTag,
5544
5548
  execute:(eventOrMessage)=>{
5545
5549
 
@@ -5550,7 +5554,7 @@ WebsocketImplementation={
5550
5554
  const dataWrapped=WebsocketImplementation.getMessageDataBothImplementations(eventOrMessage);
5551
5555
 
5552
5556
  // Channel information is stored in exchanged data :
5553
- if(dataWrapped.channelName && dataWrapped.channelName!==channelName) return;
5557
+ if(dataWrapped.channelName && dataWrapped.channelName!==channelNameParam) return;
5554
5558
 
5555
5559
  const clientSocket=nodeClientInstance.clientSocket;
5556
5560
 
@@ -5570,7 +5574,7 @@ WebsocketImplementation={
5570
5574
  },
5571
5575
 
5572
5576
 
5573
- send:(channelName, data, clientsRoomsTag=null)=>{
5577
+ send:(channelNameParam, data, clientsRoomsTag=null)=>{
5574
5578
 
5575
5579
  const clientSocket=nodeClientInstance.clientSocket;
5576
5580
 
@@ -5587,7 +5591,7 @@ WebsocketImplementation={
5587
5591
  if(!WebsocketImplementation.isInRoom(clientSocket,clientsRoomsTag)) return;
5588
5592
 
5589
5593
  // Channel information is stored in exchanged data :
5590
- let dataWrapped={channelName:channelName, data:data};
5594
+ let dataWrapped={channelName:channelNameParam, data:data};
5591
5595
 
5592
5596
 
5593
5597
  // // DBG
@@ -5598,12 +5602,12 @@ WebsocketImplementation={
5598
5602
 
5599
5603
 
5600
5604
  // // DBG
5601
- // console.log("(NODE CLIENT) SENDING DATA ! channelName:«"+channelName+"» ; clientsRoomsTag:«"+clientsRoomsTag+"»");
5605
+ // console.log("(NODE CLIENT) SENDING DATA ! channelNameParam:«"+channelNameParam+"» ; clientsRoomsTag:«"+clientsRoomsTag+"»");
5602
5606
  // console.log("(NODE CLIENT) SENDING DATA ! dataWrapped:",dataWrapped);
5603
5607
 
5604
5608
  // TODO : FIXME : Use one single interface !
5605
5609
  if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.send(dataWrapped);
5606
- else clientSocket.emit(channelName,dataWrapped);
5610
+ else clientSocket.emit(channelNameParam,dataWrapped);
5607
5611
 
5608
5612
  return nodeClientInstance;
5609
5613
  },
@@ -5641,7 +5645,7 @@ WebsocketImplementation={
5641
5645
 
5642
5646
  const clientSocket=nodeClientInstance.clientSocket;
5643
5647
  if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.addEventListener("message", doOnMessage);
5644
- else clientSocket.on(channelName, doOnMessage);
5648
+ else clientSocket.on(channelNameParam, doOnMessage);
5645
5649
 
5646
5650
  doOnConnection(nodeClientInstance, clientSocket);
5647
5651
 
@@ -5707,10 +5711,10 @@ WebsocketImplementation={
5707
5711
  const browserInstance={
5708
5712
  clientSocket:clientSocket,
5709
5713
 
5710
- receive:(channelName, doOnIncomingMessage, clientsRoomsTag=null)=>{
5714
+ receive:(channelNameParam, doOnIncomingMessage, clientsRoomsTag=null)=>{
5711
5715
 
5712
5716
  // DBG
5713
- lognow("INFO : (CLIENT-BROWSER) SETTING UP RECEIVE for :",channelName);
5717
+ lognow("INFO : (CLIENT-BROWSER) SETTING UP RECEIVE for :",channelNameParam);
5714
5718
 
5715
5719
 
5716
5720
  const doOnMessage=(eventOrMessage)=>{
@@ -5722,7 +5726,7 @@ WebsocketImplementation={
5722
5726
 
5723
5727
 
5724
5728
  // Channel information is stored in exchanged data :
5725
- if(dataWrapped.channelName && dataWrapped.channelName!==channelName) return;
5729
+ if(dataWrapped.channelName && dataWrapped.channelName!==channelNameParam) return;
5726
5730
 
5727
5731
  const clientSocket=browserInstance.clientSocket;
5728
5732
 
@@ -5735,14 +5739,14 @@ WebsocketImplementation={
5735
5739
 
5736
5740
 
5737
5741
  if(!WebsocketImplementation.useSocketIOImplementation) browserInstance.clientSocket.addEventListener("message", doOnMessage);
5738
- else browserInstance.clientSocket.on(channelName, doOnMessage);
5742
+ else browserInstance.clientSocket.on(channelNameParam, doOnMessage);
5739
5743
 
5740
5744
 
5741
5745
  return browserInstance;
5742
5746
  },
5743
5747
 
5744
5748
 
5745
- send:(channelName, data, clientsRoomsTag=null)=>{
5749
+ send:(channelNameParam, data, clientsRoomsTag=null)=>{
5746
5750
 
5747
5751
  const clientSocket=browserInstance.clientSocket;
5748
5752
 
@@ -5759,7 +5763,7 @@ WebsocketImplementation={
5759
5763
  if(!WebsocketImplementation.isInRoom(clientSocket,clientsRoomsTag)) return;
5760
5764
 
5761
5765
  // Channel information is stored in exchanged data :
5762
- let dataWrapped={channelName:channelName, data:data};
5766
+ let dataWrapped={channelName:channelNameParam, data:data};
5763
5767
 
5764
5768
 
5765
5769
  // DBG
@@ -5772,7 +5776,7 @@ WebsocketImplementation={
5772
5776
 
5773
5777
  // TODO : FIXME : Use one single interface !
5774
5778
  if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.send(dataWrapped);
5775
- else clientSocket.emit(channelName,dataWrapped);
5779
+ else clientSocket.emit(channelNameParam,dataWrapped);
5776
5780
 
5777
5781
 
5778
5782
  return browserInstance;
@@ -6152,7 +6156,7 @@ initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OP
6152
6156
  //
6153
6157
  //
6154
6158
  // const server=initNodeServer(
6155
- // // On client connection :
6159
+ // // On each client connection :
6156
6160
  //// (serverParam, clientSocketParam)=>{},
6157
6161
  // null,
6158
6162
  // // On server finalization :
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.321",
3
+ "version": "0.0.323",
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)",