Net setup interf in function
This commit is contained in:
		
							parent
							
								
									3e275e2b06
								
							
						
					
					
						commit
						639392c6de
					
				@ -34,12 +34,16 @@ class Net {
 | 
				
			|||||||
		this.interfaces.push(Loopback.instance);
 | 
							this.interfaces.push(Loopback.instance);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (interf in interfaces){
 | 
							for (interf in interfaces){
 | 
				
			||||||
			interf.onMessage.handle(pack -> handle(pack,interf));
 | 
								setupInterf(interf);
 | 
				
			||||||
			interf.listen(networkID);
 | 
					 | 
				
			||||||
			interf.listen(BRODCAST_PORT);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						private function setupInterf(interf: INetworkInterface) {
 | 
				
			||||||
 | 
							interf.onMessage.handle(pack -> handle(pack,interf));
 | 
				
			||||||
 | 
							interf.listen(networkID);
 | 
				
			||||||
 | 
							interf.listen(BRODCAST_PORT);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
		Called when a new package comes in.
 | 
							Called when a new package comes in.
 | 
				
			||||||
	**/
 | 
						**/
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user