variant with two threads --- one for listening for connections, one for running script engine.