qthread c - server functions