def main(): initialize_log() config_params = parse_config_params() # Initialize server and start server loop server = Server(config_params["port"], config_params["listen_backlog"]) server.run()
def main(): import os initialize_log() config_params = parse_config_params() # Initialize server and start server loop server = Server(config_params["port"]) server.run()
def main(): config_params = initialize_config() initialize_log(config_params["logging_level"]) # Log config parameters at the beginning of the program to verify the configuration # of the component logging.debug("Server configuration: {}".format(config_params)) # Initialize server and start server loop server = Server(config_params["port"], config_params["listen_backlog"]) server.run()
def main(): import os initialize_log() config_params = parse_config_params() hostname = socket.gethostname() IP = socket.gethostbyname(hostname) logging.info("my hostname is: {}. other ip is: {}".format( IP, config_params["cord_ip"])) with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.connect((config_params["cord_ip"], int(config_params["cord_port"]))) s.sendall(("sc" + config_params["ID"]).encode('utf-8')) s.close() # Initialize server and start server loop server = Server(config_params["port"]) server.run()