Added setter and disconnect methods for testing, made minor change to
isVaildSocket() method.