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