The \fBsrv_init()\fR function will fill the rest of the elements of this structure, such as the unix socket path and the unix socket file descriptor in order to be able to receive new connections.
functions take respectively a message to read from, and a message to write to a process.
.PP
The
.BRsrv_close_proc()
and
.BRsrv_close()
functions terminate respectively a process (closing its unix socket) and the service (closing and removing its named unix socket).
.PP
The
.BRsrv_select()
takes three arguments,
.IR*ap
an array of processes you want to listen on,
.IR*srv
the service which receives new connections and
.IR*ap_read
an array of processes which have sent a message we need to read.
.PP
The
.BRapp_connection()
function takes
.Iargc
,
.IR*argv
and
.IR*env
in argument for latter use.
It takes
.IR*srv
the pointer to the \fBstruct service\fR that should be filled (index and version parameters) and
will fill the rest of the elements of this structure, such as the unix socket path and the unix socket file descriptor of the service in order to be able to talk to it.
The function also takes
.IR*service_name
to deduce the pipe's name of the service.
Finally, the function takes
.IR*connection_buffer
and
.IRbufsize
arguments to send a buffer in the first message value for the connection, which is useful when the service needs configuration.
The function finally connects itself to the service.
\fBIn a near future, this function will be completed to invoke transparently the remote service\fR.
.PP
The
.BRapp_read()
and
.BRapp_write()
functions take respectively a message to read from, and a message to write to the service.
.PP
The
.BRapp_close()
function finally ends the communication to the service.
Most of the functions return an integer less than zero if there is an error.
.PP
For
.BRsrv_select()
if there is a new connection, the function will return \fBCONNECTION\fR, if there is one or more processes talking the function will return \fBAPPLICATION\fR and finally if there are both a new connection and a process talking the function will return \fBCON_APP\fR.