remote_node.h
author Tero Marttila <terom@fixme.fi>
Fri, 06 Jun 2008 03:24:55 +0300
changeset 9 fb6632e6c1bb
child 13 ee426f453cf5
permissions -rw-r--r--
two new modules, remote_node and remote_pool

committer: Tero Marttila <terom@fixme.fi>
#ifndef REMOTE_NODE_H
#define REMOTE_NODE_H

#include <sys/socket.h>

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

struct remote_node {
    int valid;

    /*
     * Static information
     */

    // the remote address, note how this can both AF_INET and AF_LOCAL
    struct sockaddr_storage addr;

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

    // 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 host/port.
 *
 * Portname may also be NULL, in which case the default port is used.
 *
 * 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 *hostname, const char *portname);

#endif /* REMOTE_NODE_H */