added thread debug info and closed socket after send

Signed-off-by: Mark Kelly <mark.kelly@lexisnexis.com>