fix crushing in emulator mode
change client-server hand-shaking mechanism
fix mutex locking error in TempPollingThread class run() method