def run_server(server_port):
    'Run the UDP pinger server\n    '
    with Socket(socket.AF_INET, socket.SOCK_DGRAM) as server_socket:
        server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        server_socket.bind(('', server_port))
        print('Ping server ready on port', server_port)
        while True:
            (_, client_address) = server_socket.recvfrom(1024)
            server_socket.sendto(''.encode(), client_address)
    return 0
Run the UDP pinger server
def run_server(server_port):
    '\n    '
    with Socket(socket.AF_INET, socket.SOCK_DGRAM) as server_socket:
        server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        server_socket.bind((, server_port))
        print('Ping server ready on port', server_port)
        while True:
            (_, client_address) = server_socket.recvfrom(1024)
            server_socket.sendto(.encode(), client_address)
    return 0