remote_node.h
author Tero Marttila <terom@fixme.fi>
Wed, 27 Aug 2008 21:30:32 +0300
changeset 41 540737bf6bac
parent 26 6d615203d963
permissions -rw-r--r--
sending requests, and partial support for receiving -- incomplete, not tested
#ifndef REMOTE_NODE_H
#define REMOTE_NODE_H

#include <sys/socket.h>

#include "config.h"

/*
 * Information about a single remote render node.
 */

struct remote_node {
    int valid;

    /*
     * Static information
     */
    
    // the remote endpoint
    struct config_endpoint endpoint;

    // how many render requests this node can process concurrently
    int parallel_renders;
    
    /*
     * Dynamic information
     */

    // an estimate of how many render requests this node is currently processing
    int current_load;
};

/*
 * Initialize the given remote_node struct to work with the render node at the given address (à la parse_address).
 *
 * Note that this is a blocking function, and should only be called at startup.
 *
 * returns nonzero on error, zero on success.
 */
int remote_node_init (struct remote_node *node_info, const char *addr_spec);

#endif /* REMOTE_NODE_H */