Communication between server and client with threadpool implemented