fixed disconnect error handling on client and added more comments.

Signed-off-by: Miethop <miethpomail@yahoo.co.uk>