tec_create_handle

The tec_create_handle function establishes a handle for sending events to the event server.

Synopsis

tec_handle_t tec_create_handle(char *location, unsigned short port, int oneway, tec_delivery_type type)

Arguments

location
The host name or host protocol address of the event server.
oneway
Used for managed node adapters only, and is used to designate whether calls to tec_put_event returns exceptions to the caller in the event of failure. A value of one (1) means that exceptions, if any, are not returned to the caller of tec_put_event because the caller does not wait for a response from the oserv process. A value of zero (0) means that exceptions are returned to the caller because the caller waits for the oserv process to return the success or failure of the method.
port
The port the event server listens on.
type
The possible values are the following:
  • connection_less
  • connection_oriented
  • use_default

The use_default value reads the setting from the configuration file for the ConnectionMode keyword and sets up a connectionless handle if the ConnectionMode keyword is not specified.

Examples

#include "tec_eeif.h"
if((th = tec_create_handle(tec_server, port, oneway, type)) == NULL) {
    fprintf(stderr, “%s: tec_create_handle failed errno=,
        progname, tec_errno);
    exit(1);
}

Return codes

A handle to an internal data structure. The handle is used in calls to tec_put_event. If the location is NULL, the configuration file ServerLocation entry is used to derive the location. If the port is zero, the ServerPort entry is used, if any; or else the portmapper is queried for the port on which the event server listens.