!7 sclass OIC > DynPrintLogAndEnabled { switchable int port = 6000; switchable bool verbose; transient OSInstancesConnector connector; start-thread { if (!enabled) ret; connector = OSInstancesConnector(port); connector.onLineReceived.add(voidfunc(S line, O socket, O state) enter { if (verbose) print("Line received: " + shorten(50, line)); }); connector.start(); print("Connector on port " + port + " listening"); print("IPs: " + myIPs()); dm_registerAs_direct instancesConnector(); } void cleanMeUp { dispose connector; } // API void sendToChannel(S channel, S line) { connector.getChannel(channel).handleLine(line); } }