Tue 27 Aug 00:14:56 CEST 2024
This commit is contained in:
		
							parent
							
								
									7656a6896b
								
							
						
					
					
						commit
						2bc204c71d
					
				
							
								
								
									
										29
									
								
								test/test-std.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								test/test-std.js
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,29 @@
 | 
				
			||||||
 | 
					var proto='http';
 | 
				
			||||||
 | 
					//var host='localhost';
 | 
				
			||||||
 | 
					var host ='ag-0.de' 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if (proto=='http') {
 | 
				
			||||||
 | 
					  p=port(DIR.IP('http://localhost:*'))
 | 
				
			||||||
 | 
					  connect(DIR.IP('http://'+host+':10001'))
 | 
				
			||||||
 | 
					} else {
 | 
				
			||||||
 | 
					  p=port(DIR.IP('udp://localhost:*'))
 | 
				
			||||||
 | 
					  connect(DIR.IP('udp://'+host+':10002'))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					var counter=0;
 | 
				
			||||||
 | 
					function postit(what)  {
 | 
				
			||||||
 | 
					  return function (msg)  {
 | 
				
			||||||
 | 
					    print(what,msg);
 | 
				
			||||||
 | 
					    counter++; if (counter==4) exit()
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					on('link+',function () {
 | 
				
			||||||
 | 
					  var nodes = connected(DIR.IP('%'));
 | 
				
			||||||
 | 
					  print(nodes)
 | 
				
			||||||
 | 
					  if (nodes.length) {
 | 
				
			||||||
 | 
					    Std.info(nodes[0],'node',postit('std.info node'))
 | 
				
			||||||
 | 
					    Std.status(nodes[0],'node',postit('std.status node'))
 | 
				
			||||||
 | 
					    Std.status(nodes[0],'agents',postit('std.status agents'))
 | 
				
			||||||
 | 
					    Std.status(nodes[0],'links',postit('std.status links'))
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					print('Done')
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user