Struct dbServer

Struct Documentation

struct dbServer

Server information structure.

Every server layer should initialize and register an instance of this structure with the IOC by passing it to the dbRegisterServer() routine.

All methods in this struct are optional; use NULL if a server is unable to support a particular operation (or if it hasn’t been implemented yet).

Control Methods

These control methods for the server will be called by routines related to iocInit for all registered servers in turn when the IOC is being initialized, run, paused and stopped respectively.

void (*init)(void)

Server init method.

Called for all registered servers by dbInitServers().

void (*run)(void)

Server run method.

Called for all registered servers by dbRunServers().

void (*pause)(void)

Server pause method.

Called for all registered servers by dbPauseServers().

void (*stop)(void)

Server stop method.

Called for all registered servers by dbStopServers().

Public Members

ELLNODE node

Linked list node; initialize to ELLNODE_INIT.

const char *name

A short server identifier; printable, with no spaces.

void (*report)(unsigned level)

Print level-dependent status report to stdout.

Param level

Interest level, specifies how much detail to print.

void (*stats)(unsigned *channels, unsigned *clients)

Get number of channels and clients currently connected.

Param channels

NULL or pointer for returning channel count.

Param clients

NULL or pointer for returning client count.

int (*client)(char *pBuf, size_t bufSize)

Get identity of client initiating the calling thread.

Must fill in the buffer with the client’s identity when called from a thread that belongs to this server layer. For other threads, the method should do nothing, just return -1.

Param pBuf

Buffer for client identity string.

Param bufSize

Number of chars available in pBuf.

Return

-1 means calling thread is not owned by this server. 0 means the thread was recognized and pBuf has been filled in.