aotrautils 0.0.198 → 0.0.201

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.0.0.000 (19/07/2022-01:41:24)»*/
3
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (19/07/2022-02:24:23)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4828
4828
 
4829
4829
 
4830
4830
 
4831
- /*utils CLIENT library associated with aotra version : «1.0.0.000 (19/07/2022-01:41:24)»*/
4831
+ /*utils CLIENT library associated with aotra version : «1.0.0.000 (19/07/2022-02:24:23)»*/
4832
4832
  /*-----------------------------------------------------------------------------*/
4833
4833
  /* ## Utility global methods in a browser (htmljs) client environment.
4834
4834
  *
@@ -11678,7 +11678,7 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
11678
11678
 
11679
11679
 
11680
11680
 
11681
- /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (19/07/2022-01:41:24)»*/
11681
+ /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (19/07/2022-02:24:23)»*/
11682
11682
  /*-----------------------------------------------------------------------------*/
11683
11683
 
11684
11684
 
@@ -12884,7 +12884,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
12884
12884
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
12885
12885
 
12886
12886
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
12887
- /*utils SERVER library associated with aotra version : «1.0.0.000 (19/07/2022-01:41:24)»*/
12887
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (19/07/2022-02:24:23)»*/
12888
12888
  /*-----------------------------------------------------------------------------*/
12889
12889
 
12890
12890
 
@@ -13409,8 +13409,12 @@ WebsocketImplementation={
13409
13409
  clientSocket.isAlive=false;
13410
13410
  try{
13411
13411
 
13412
- if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.ping();
13413
- else clientSocket.emit("ping");
13412
+ // OLD :
13413
+ // if(!WebsocketImplementation.useSocketIOImplementation) clientSocket.ping();
13414
+ // else clientSocket.emit("ping");
13415
+ nodeServerInstance.send("protocol",{type:"ping"});
13416
+
13417
+
13414
13418
 
13415
13419
  }catch(error){
13416
13420
  lognow("ERROR : A problem occurred when tried to ping client socket : ",error);
@@ -13431,15 +13435,22 @@ WebsocketImplementation={
13431
13435
 
13432
13436
  }, nodeServerInstance.clientTimeoutMillis);
13433
13437
 
13434
- if(!WebsocketImplementation.useSocketIOImplementation){
13435
- clientSocket.on("pong",()=>{
13436
- clientSocket.isAlive=true;
13437
- });
13438
- }else{
13439
- clientSocket.on("ping",()=>{
13440
- clientSocket.isAlive=true;
13441
- });
13442
- }
13438
+
13439
+ // // OLD :
13440
+ // if(!WebsocketImplementation.useSocketIOImplementation){
13441
+ // clientSocket.on("pong",()=>{
13442
+ // clientSocket.isAlive=true;
13443
+ // });
13444
+ // }else{
13445
+ // clientSocket.on("ping",()=>{
13446
+ // clientSocket.isAlive=true;
13447
+ // });
13448
+ // }
13449
+
13450
+ nodeServerInstance.receive("protocol",(message)=>{
13451
+ if(message.type!=="pong") return;
13452
+ clientSocket.isAlive=true;
13453
+ });
13443
13454
 
13444
13455
 
13445
13456
 
@@ -13659,12 +13670,25 @@ WebsocketImplementation={
13659
13670
  if(!WebsocketImplementation.useSocketIOImplementation) nodeClientInstance.clientSocket.addEventListener("open",doAllOnConnection);
13660
13671
  else nodeClientInstance.clientSocket.on("connect",doAllOnConnection);
13661
13672
 
13673
+
13662
13674
  },
13663
13675
 
13664
13676
 
13665
13677
  };
13666
13678
 
13667
13679
 
13680
+
13681
+ // CURRENT 3
13682
+ nodeClientInstance.receive("protocol",(message)=>{
13683
+ if(message.type!=="ping") return;
13684
+ nodeClientInstance.send("protocol",{type:"pong"});
13685
+
13686
+ // DBG
13687
+ lognow("DEBUG : CLIENT : Pong sent.");
13688
+ });
13689
+
13690
+
13691
+
13668
13692
  return nodeClientInstance;
13669
13693
  },
13670
13694
 
@@ -13798,6 +13822,18 @@ WebsocketImplementation={
13798
13822
  };
13799
13823
 
13800
13824
 
13825
+
13826
+
13827
+ // CURRENT 3
13828
+ browserInstance.receive("protocol",(message)=>{
13829
+ if(message.type!=="ping") return;
13830
+ browserInstance.send("protocol",{type:"pong"});
13831
+
13832
+ // DBG
13833
+ lognow("DEBUG : CLIENT : Pong sent.");
13834
+ });
13835
+
13836
+
13801
13837
  return browserInstance;
13802
13838
  },
13803
13839
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.198",
3
+ "version": "0.0.201",
4
4
  "main": "aotrautils.build.js",
5
5
  "description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",