remote_node.c
author Tero Marttila <terom@fixme.fi>
Sat, 30 Aug 2008 19:13:15 +0300
changeset 49 10c7dce1a043
parent 26 6d615203d963
permissions -rw-r--r--
autogenerate the memcache_test help output, and pipeline memcache requests
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <assert.h>

#include "remote_node.h"
#include "common.h"
#include "render_net.h"
#include "socket.h"

int remote_node_init (struct remote_node *node_info, const char *addr_spec) {
    // zero out the struct
    memset(node_info, 0, sizeof(*node_info));

    // XXX: currently, this is hardcoded to one, but should be automagically discovered
    node_info->parallel_renders = 1;

    // build the endpoint
    endpoint_init(&node_info->endpoint, RENDER_PORT);

    if (endpoint_parse(&node_info->endpoint, addr_spec))
        return -1;
    
    // success!
    node_info->valid = 1;
    return 0;
}