When window closing sockets are shutdown.
Event handler added.
PC3API_dn receive thread added.