multithreaded server with heartbeat