bugfix: there are cases that self.transport is null when we try to close it on heratbeat timer