def METHOD_NAME(sock):
    """ process data recieved on socket"""
    # receiving data from the socket.
    data = sock.recv(RECV_BUFFER).decode()
    if data:
        if data == 'test\n':
            send_message(sock, "Yep\n")
        elif data == 'exit\n':
            close_socket(sock)
        elif data.startswith('interval'):
            try:
                global interval
                interval = int(data.split(":")[1][:-1])
            except Exception:
                send_message(sock, "In-correct interval data")
        elif data.startswith('metrics'):
            metrics = data[:-1].split("metrics:")[1].split("\t")
            server_pid = get_process_pid_from_file(get_server_pidfile(PID_FILE))
            server_process = get_server_processes(server_pid)
            start_metric_collection(server_process, metrics, interval, sock)
        else:
            # TODO - decide what to do here
            pass
    else:
        # remove the socket that's broken
        if sock in SOCKET_LIST:
            SOCKET_LIST.remove(sock)