This includes the communication thread with sockets.