remote_node.c
author Tero Marttila <terom@fixme.fi>
Fri, 29 Aug 2008 23:31:17 +0300
changeset 48 1c67f512779b
parent 26 6d615203d963
permissions -rw-r--r--
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
#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;
}