remote_node.h
author Tero Marttila <terom@fixme.fi>
Sat, 07 Jun 2008 05:05:18 +0300
changeset 13 ee426f453cf5
parent 9 fb6632e6c1bb
child 26 6d615203d963
permissions -rw-r--r--
* fix some (of the) stupid things in Makefile
* increment remote_node->current_load in remote_pool_get
* re-add render_init
* add render_raw module to handle non-PNG rendering
* update render_local to support RENDER_RAW
* working (but limited and inefficient) implementation of render_multi
* fixes to render_png
* improve/clean up render_remote
* mark internal function static
* make web_main use render_multi
* random bugfixes (possibly due to vim acting weird re file recovery post-crash)

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
     */

    // 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 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 */