Infrasctucture AppSrv Function Reference

AppSrv
#include "appsrv.h"

This is the base of most Orb servers.    It has a single table which maps services (codes) to functions, error reporting (builds a response message), automatic reconnection to the Orb if it should die or be killed, and multiple server ports.    Examples abound in the inf/inf subdirectoy.

asErr     asGetState     asSetState     asMain     asMkRsp     asSndMsg    

int  asErr( char* fmt, ... elipsis )
Register an error from an appSrv function. The message is formatted and passed to trcErr() for logging. A response message is prepared and sent back to the caller (usually the ORB).

int  asGetState( )
Get the current state of the appSrv. This isn't really implemented yet, but some functionality does exist.

int  asSetState( )
Set the current state of the appSrv. This isn't really implemented yet, but some functionality does exist.

int  asMain( int argc, char* argv[] )
The server's main function will initialize and register any config, options, etc then call asMain which will not return. From this point on, any requests will be passed to the registered SVC funtions.

char*  asMkRsp( int oldHandle, int stat )
Create a response message to the last received command.

int  asSndMsg( int typ, int cod, int stat, pfi_t ldFun, void* ldArg )
A message destined for the Broker (ORB) will be created and the type, code, status, etc fields will be set per these arguments.