..
Removed thread.
Add ackedPackets after log.
Close socket later.
Minor changes.