Write The Source Code - Netscape ENTERPRISE SERVER 6.0 - NSAPI PROGRAMMER GUIDE Manual

Nsapi
Table of Contents

Advertisement

Creating and Using Custom SAFs
Load and Initialize the SAF
3.
by editing the
-- Load the shared library file containing your custom SAF(s).
-- Initialize the SAF if necessary.
Instruct the Server to Call the SAFs
4.
by editing
Reconfigure the Server
5.
Test the SAF
6.
by accessing your server from a browser with a URL that triggers your
function.
The following sections describe these steps in greater detail.

Write the Source Code

Write your custom SAFs using NSAPI functions. For a summary of some of the
most commonly used NSAPI functions, see the section "Overview of NSAPI C
Functions," on page 123. Chapter 5, "NSAPI Function Reference," provides
information about all of the routines available.
For examples of custom SAFs, see
and also see Chapter 6, "Examples of Custom SAFs."
The signature for all SAFs is:
int function(pblock *
For more details on the parameters, see the section "SAF Parameters," on page 112.
The Enterprise Server runs as a multi-threaded single process. On UNIX platforms
there are actually two processes (a parent and a child) for historical reasons. The
parent process performs some initialization and forks the child process. The child
process performs further initialization and handles all the HTTP requests.
Keep these things in mind when writing your SAF. Write thread-safe code.
Blocking may affect performance. Write small functions with parameters and
configure them in
so that you can determine the source of problems and fix them.
116
Netscape Enterprise Server NSAPI Programmer's Guide • November 2001
file to:
obj.conf
to call your custom SAF(s) at the appropriate time.
obj.conf
nsapi/examples/
pb
, Session *
. Carefully check and handle all errors. Also log them
obj.conf
in the server root directory
sn
rq
, Request *
);

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise server 6.0

Table of Contents