public boolean isAlive(){
  return !socket.isClosed() && !socket.isInputShutdown() && !socket.isOutputShutdown();
}

public boolean isAlive ( ) { return ! socket . isClosed ( ) && ! socket . isInputShutdown ( ) && ! socket . isOutputShutdown ( ) ; }
returns true if this connection is alive .
