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

client hangs after shutdown fixes #issue821