remote_node.c
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
#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;
}