Exit thread properly when done reading from socket.
Exit thread properly when done reading from socket.

Fixes #39

twood02/adv-net-samples,twood02/adv-net-samples,twood02/adv-net-samples,twood02/adv-net-samples,gwAdvNet2015/adv-net-samples,gwAdvNet2015/adv-net-samples,gwAdvNet2015/adv-net-samples,gwAdvNet2015/adv-net-samples,twood02/adv-net-samples,twood02/adv-net-samples,gwAdvNet2015/adv-net-samples,gwAdvNet2015/adv-net-samples