MWSERVER

Section: MidWay Users Manual (1)
Updated: DATE
Index Return to Main Contents
 

NAME

mwserver - The MidWay generic server.  

SYNOPSIS

mwserver [-A url] [-l debuglevel] {-s service[:function]} librarys...  

DESCRIPTION

This program provides the simplest way of making a service routine in C. You write your functions as specified in mwservice(3C). Then you link it into a shared library. You give this library as argument to mwserver and you tell it via the -s option which functions that you want to provide as a service.
You can give as many -s option and libraries as arguments as you can fit on the command line.

If you want to have a start up and shutdown procedure then dlopen(3) specify that for each library you have the function _init is run when the library is loaded, and _fini when the library is unloaded. In addition mwserver will after having loaded all the libraries look for a function mwinit. The first one and only the first one found in the library list are executed. Likewise on graceful shutdown mwserver looks for mwexit.

 

EXAMPLE

Given a C file example.c:
#include <MidWay.h>

int SERVICE1(mwsvcinfo *si) {
mwreply (..);
};
You now compile it with:
gcc -c example.c
gcc -shared -o example.so example.o
Now you start the server by this command:
mwserver -s SERVICE1 -s service1:SERVICE1 example.so
Your service routine are now available both as the service SERVICE1 and service1, check with mwadm(1).  

ENVIRONMENT

LD_LIBRARY_PATH
If you don't give the full path of your lib to mwserver, it will look for your library in the current working directory, then in the bin directory of your MidWay instance (see mwd(1). After that it will follow the specification of dlopen(3) with says that it will use LD_LIBRARY_PATH, /etc/ls.so.cache, /usr/lib, and /lib in that order to find the library.
MWURL
see mwd(1).
MWDIR
see mwd(1).
 

SEE ALSO

MidWay(7),mwadm(1),mwd(1),mwservice(3C),dlopen(3)  

WARNINGS

The intention is to make mwd start and stops servers. If a server started directly by giving the mwserver command, and it core dumps, it will take some 60 - 120 seconds for mwd to clean up (NYI). mwserver is intended for development use only.  

BUGS

It is not possible to provide the same function/symbol in two libraries.

If the dld implementaion I have on Linux RH 6.0, I can't have _init and _fini function in a library and load it with dlopen(), as the man page says I can do.


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE
ENVIRONMENT
SEE ALSO
WARNINGS
BUGS

This document was created by man2html, using the manual pages.
Time: 11:18:49 GMT, October 24, 2000