Also consider the option of doing it all in a single thread. You don't need a separate thread just to receive data over network.