Code for server etc. converted to nng but not tested