From 639392c6de7317eb52193b68525914300953e7aa Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Tue, 1 Mar 2022 12:56:15 +0100 Subject: [PATCH] Net setup interf in function --- src/kernel/net/Net.hx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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. **/