client hangs after shutdown fixes #issue821
small fix
test for issue #821
Merge pull request #822 from gurbuzali/fix/3.x/issue821-master

client hangs after shutdown fixes #issue821