Skip to main content
Interface class used to run a dynamic data server in a thread accepting incoming client connections. Usage:
1.) Instantiate DVS::IServer using DVS::CREATE_SERVER_INSTANCE() method
2.) Set options using DVS::IServer::set_options() or DVS::IServer::set_option()
3.) Startup server using DVS::IServer::startup()
4.) If needed see if it’s running via DVS::IServer::running()
5.) Shutdown server using DVS::IServer::shutdown()
6.) Destroy instance using DVS::DESTROY_SERVER_INSTANCE()

Members

Public Functions

Function IServer

Default Return type:

Function ~IServer

Default Return type:

Function IServer

Default Parameters:
  • IServer &&
Return type:

Function operator=

Default Parameters: Return type: IServer &

Function IServer

Support Copying Parameters:
  • const IServer &
Return type:

Function operator=

Default Parameters: Return type: IServer &

Function set_options

Set a Collection of Options on the Server. Overwrites Previous Options See. See Server Options. Parameters: Parameters:
  • const std::map< const char *, const char * > & options
Return type: void

Function set_option

Set a Specific Option on the Server, These Are Used During Startup See See Server Options. Current available options:
CACHE_URI: This will set the location and type of cache to store data to.
Parameters:
  • key: Name of Option to Set
  • value: Value of Option
Parameters:
  • const char * key
  • const char * value
Return type: void

Function clear_options

Clear All Options From the Server. Return type: void

Function running

Check to See if the Server Is Running. Currently this is a dumb check to see if the server was tried to start. If port listening failed this will call will not fail currently. Returns: True if Running/Started Return type: bool

Function get_timestep_count

Return the Current Number of Pending and Complete Timesteps in the Server Simple count of the current state of the timesteps in the server Parameters:
  • num_pending: The Number of Pending Timesteps Not Complete Yet
  • num_complete: num_complete the Number of Complete Timesteps
Returns: dvs_ret DVS_SERVER_NOT_STARTED or DVS_NONE Parameters:
  • uint32_t & num_pending
  • uint32_t & num_complete
Return type: dvs_ret

Function startup

Start the Server. server_number is used by the DVS server, for each group of servers this number should be unique and monotonically increasing with no gaps (valid: 0, 1, 2 invalid: 0, 2) local_ranks is used to determine how many clients will be connecting to this server Parameters:
  • server_number: The Server Number (Zero Based) for This Server, Should Be Unique for Each Server in This Server Group
  • local_ranks: Number of Local Ranks This Server Will Handle
Returns: dvs_ret DVS_NONE on success, else error code Parameters:
  • uint32_t server_number
  • uint32_t local_ranks
Return type: dvs_ret

Function startup_unthreaded

Startup a Server Manually Without Threads. This method is for when a user wants to manually run their own server to more tightly control the execution and threading model. This call WILL block until the first timestep is received and will not return unless terminating() has been called from another thread or interrupt. server_number is used by the DVS server, for each group of servers this number should be unique and monotonically increasing with no gaps (valid: 0, 1, 2 invalid: 0, 2) local_ranks is used to determine how many clients will be connecting to this server The normal call chain would be to call startup_unthreaded() and then loop calling update() until some end condition is met. Please see test_dvs_server.cpp for an example. Parameters:
  • server_number: The Server Number (Zero Based) for This Server, Should Be Unique for Each Server in This Server Group
  • local_ranks: Number of Local Ranks This Server Will Handle
Returns: dvs_ret DVS_NONE on success, else error code Parameters:
  • uint32_t server_number
  • uint32_t local_ranks
Return type: dvs_ret

Function update

Perform a Server Update. This method performs a server update. This will: 1.) Perform a complete timestep check and flush complete timesteps to the cache 2.) Perform a check if any new delete_item calls should be processed 3.) Perform a check to see if the dataset definition needs to be updated The number of pending timesteps from get_timestep_count() will not update unless this is called. Important: This is not needed to be called if using the normal startup() procedure and should only be used when manually running the server with startup_unthreaded. This must be called periodically for the server to function properly. Returns: dvs_ret DVS_NONE on Success Return type: dvs_ret

Function terminating

Call to Begin Terminating the Server. This method begins terminating the server when startup_unthreaded() is invoked. This will cause new updates sending new timesteps, to fail and exit early from any waiting calls on the server. Important: This call is not needed if using the normal startup method as it will handle this for you. Returns: dvs_ret DVS_NONE on Success, DVS_SERVER_FAILED_READER_CREATE if the Server Wasn’t Started Return type: dvs_ret

Function shutdown

Shutdown the Server, Also Called on Server Destruction by DVS::DESTROY_SERVER_INSTANCE(). Return type: void

Function create_transport

Create a Transport Object to Communicate With Server, Must Be Destroyed. Parameters:
  • shared_secret: The Transport Protocol Shared Secret String Used to Validate Connections. It May Be an Empty String. If “SERVER_SECURITY_SECRET” Is Set as a Server Option shared_secret Will Be Ignored.
Returns: ITransport* Instance to Transport Object Owned by Server Instance Parameters:
  • const std::string & shared_secret
Return type: ITransport *

Function get_uri

Get URI of This Server. Returns: URI This Server Was Created With Return type: const char *

Function create_query

Create a DVS Query Instance. This Will Inherit the DVS Server Reader Instance. Parameters:
  • parent: An Eventual Parent Query to Create the New Query With. Defaults to nullptr
  • filter: An Eventual Filter String to Apply to the New Query. Defaults to the Empty String
Returns: The Query Instance Created. Parameters:
  • const std::string & filter = std::string()
  • DVS::IQuery * parent = nullptr
Return type: DVS::IQuery *