diff --git a/src/kernel/net/Net.hx b/src/kernel/net/Net.hx index 06c928f..f38decf 100644 --- a/src/kernel/net/Net.hx +++ b/src/kernel/net/Net.hx @@ -34,12 +34,16 @@ class Net { this.interfaces.push(Loopback.instance); for (interf in interfaces){ - interf.onMessage.handle(pack -> handle(pack,interf)); - interf.listen(networkID); - interf.listen(BRODCAST_PORT); + setupInterf(interf); } } + 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. **/