mb_bind
mb_bind
SYNOPSIS
int mb_bind( char *host, char *port_name )
DESCRIPTION
mb_bind
connects the calling process to a bus on host.
If host is (char *)0
, the process is connected to a local bus. Specify a port_name other than (char *)0
to connect the calling process to a bus listening to a port name other than the default.
To connect a bus to a port other than magicbus, add a line in /etc/services such as:
privatebus 6667/tcp # reserved magicbus
Start another bus with:
/usr/local/etc/mbd privatebus
Hopping on several buses is possible, but in order to easily find each other, all processes are usually registered on the same bus on the same host.
mb_bind
returns a descriptor, actually a mere socket, referencing the connection.
This connector is used by all the other functions of the bus.
If an error occurred, mb_bind
returns -3 if host isn’t 0 and gethostbyname
returned an error, -2 if port_name or magicbus by default could not be found by getservbyname
, or -1 if another error occurred in which case the global system variable errno is set to indicate the error.
Comments