dtn::APIServer Class Reference

Class that implements the main server side handling of the DTN application IPC. More...

#include <APIServer.h>

List of all members.

Public Member Functions

 APIServer ()
 The constructor checks for environment variable overrides of the address / port.
virtual void shutdown_hook ()
void accepted (int fd, in_addr_t addr, u_int16_t port)
bool enabled () const
boolenabled_ptr ()
in_addr_t local_addr () const
in_addr_t * local_addr_ptr ()
u_int16_t local_port () const
u_int16_t * local_port_ptr ()
void register_client (APIClient *)
void unregister_client (APIClient *)

Protected Attributes

bool enabled_
 whether or not to enable it
in_addr_t local_addr_
 local address to bind to
u_int16_t local_port_
 local port to use for api
std::list< APIClient * > client_list
 active clients
oasys::SpinLock client_list_lock
 synchronizer

Detailed Description

Class that implements the main server side handling of the DTN application IPC.

Definition at line 43 of file APIServer.h.


Constructor & Destructor Documentation

dtn::APIServer::APIServer (  ) 

The constructor checks for environment variable overrides of the address / port.

It is expected that someone else will call bind_listen_start() on the APIServer instance.

Definition at line 56 of file APIServer.cc.

References DTN_IPC_PORT, enabled_, end, local_addr_, and local_port_.


Member Function Documentation

void dtn::APIServer::accepted ( int  fd,
in_addr_t  addr,
u_int16_t  port 
)

Definition at line 108 of file APIServer.cc.

References register_client().

bool dtn::APIServer::enabled (  )  const [inline]

Definition at line 58 of file APIServer.h.

References enabled_.

Referenced by dtn::DTND::main().

bool* dtn::APIServer::enabled_ptr (  )  [inline]

Definition at line 59 of file APIServer.h.

References enabled_.

Referenced by dtn::APICommand::APICommand().

in_addr_t dtn::APIServer::local_addr (  )  const [inline]

Definition at line 61 of file APIServer.h.

References local_addr_.

Referenced by dtn::DTND::main().

in_addr_t* dtn::APIServer::local_addr_ptr (  )  [inline]

Definition at line 62 of file APIServer.h.

References local_addr_.

Referenced by dtn::APICommand::APICommand().

u_int16_t dtn::APIServer::local_port (  )  const [inline]

Definition at line 64 of file APIServer.h.

References local_port_.

Referenced by dtn::DTND::main().

u_int16_t* dtn::APIServer::local_port_ptr (  )  [inline]

Definition at line 65 of file APIServer.h.

References local_port_.

Referenced by dtn::APICommand::APICommand().

void dtn::APIServer::register_client ( APIClient c  ) 

Definition at line 170 of file APIServer.cc.

References client_list, and client_list_lock.

Referenced by accepted().

void dtn::APIServer::shutdown_hook (  )  [virtual]

Definition at line 132 of file APIServer.cc.

References client_list, client_list_lock, count, EACH_SPIN_TIME, and MAX_SPIN_TIME.

void dtn::APIServer::unregister_client ( APIClient c  ) 

Definition at line 177 of file APIServer.cc.

References client_list, and client_list_lock.

Referenced by dtn::APIClient::close_client().


Member Data Documentation

std::list<APIClient *> dtn::APIServer::client_list [protected]

active clients

Definition at line 75 of file APIServer.h.

Referenced by register_client(), shutdown_hook(), and unregister_client().

oasys::SpinLock dtn::APIServer::client_list_lock [protected]

synchronizer

Definition at line 76 of file APIServer.h.

Referenced by register_client(), shutdown_hook(), and unregister_client().

whether or not to enable it

Definition at line 71 of file APIServer.h.

Referenced by APIServer(), enabled(), and enabled_ptr().

in_addr_t dtn::APIServer::local_addr_ [protected]

local address to bind to

Definition at line 72 of file APIServer.h.

Referenced by APIServer(), local_addr(), and local_addr_ptr().

u_int16_t dtn::APIServer::local_port_ [protected]

local port to use for api

Definition at line 73 of file APIServer.h.

Referenced by APIServer(), local_port(), and local_port_ptr().


The documentation for this class was generated from the following files:
Generated on Sun Nov 21 11:40:55 2010 for DTN Reference Implementation by  doxygen 1.6.3