Validate the options or exit()

def validate(self,options):
        """
        Validate the options or exit()
        """
        if not options.port:
            self.parser.error("'port' is required")
        if options.port == options.monitor_port:
            self.parser.error("'port' and 'monitor-port' must not be the same.")
        if options.buffer_size <= 0:
            self.parser.error("'buffer_size' must be > 0.")
        try:
            codecs.getencoder(options.char_encoding)
        except LookupError:
            self.parser.error("invalid 'char-encoding' %s" % options.char_encoding)

        if not options.host:
           options.host = socket.gethostname()