DIM
Distributed Information Management
System


4.6 Miscellaneous Library (DIM)

Detailed description of additional routines contained in the DIM library : 

dim_set_dns_node

Set the DNS node name.


Format

int dim_set_dns_node (char *node_name)

Arguments

char *node_name

The node (or a list of nodes separated by commas) where the DNS is (possibly) running.

Returns

int return_code

Returns 1 if successful.

Description

This routine can be called by a server or a client program before publishing or subscribing to any services in order to programmatically declare the node where the DNS is running. If this call is not used the environment variable DIM_DNS_NODE will be used instead.

A list of node names separated by commas can be given as a parameter, in which case the server or the client will use the first name server found running from the list.

Note: If a process is at the same time a DIM server and a DIM client, this function sets the DIM_DNS_NODE for both parts. In order to change independently the DIM_DNS_NODE for the server or for the client part please use (respectively): dis_set_dns_node() and dic_set_dns_node().


dim_get_dns_node

Get the DNS node name.


Format

int dim_get_dns_node (char *node_name)

Arguments

char *node_name

Returns the node (or a list of nodes separated by commas) where the DNS is (possibly) running.

Returns

int return_code

Returns 1 if successful.

Description

This routine can be called by a server or a client program to find out where the DNS was defined to be running.


dim_set_dns_port

Set the DNS port number.


Format

int dim_set_dns_port (int port)

Arguments

int port

The port number of the DNS.

Returns

int return_code

Returns 1 if successful.

Description

This routine can be called by a server or a client program before publishing or subscribing to any services, together with dim_set_dns_node() in order to programmatically declare the port number used by the DNS (if the DNS was started with a non-default port number by using the environment variable DIM_DNS_PORT). The default port number of the DNS is 2505.

Note: If a process is at the same time a DIM server and a DIM client, this function sets the DIM_DNS_PORT for both parts. In order to change independently the DIM_DNS_PORT for the server or for the client part please use (respectively): dis_set_dns_port() and dic_set_dns_port().


dim_get_dns_port

Get the DNS port number.


Format

int dim_get_dns_port ()

Returns

int port

Returns the DNS port number.

Description

This routine can be called by a server or a client program to find out what port number was defined for the DNS.


dim_start_thread

Start a user Thread

Format

void dim_start_thread (user_routine, tag)

Arguments

void *user_routine;

The address of a routine to be executed by this thread.

long tag;

A parameter to be sent to the user_routine in order to identify the thread.

Description

This routine starts a thread. The user_routine will be called and run as a separate thread.

user_routine

Routine written by the user, called when a thread is started by dim_start_thread().

Format

void user_routine (tag)

Arguments

long tag;

The parameter that identifies the thread. The tag given to dim_start_thread.

Description

This routine is run in a separate thread when dim_start_thread() is called.