def METHOD_NAME(agent, sender):
    """Send the start-up and keep-alive events"""
    try:
        sender.send_event(agent.startup_msg)
        # Wait 1 seconds to ensure that the message has ben sent before closing the socket.
        sleep(1)
    finally:
        sender.socket.close()