Added ::isAlive() method to check socket is alive