Basic implementation of singlethread client-server app