Removed unnecessary comments and commented out code.
Moved function into anonymous namespace and rename.
Cleanup if statements.
Removed unused define.
Change to automatic variable for ZMW socket wrapper. No need for allocation on heap.
Cleanup of logging to avoid __FUNCTION__
Adjusted comments around if-statements.