Skip to main content

Key Constants & Config Struct

Key Constants​

Defined in nsb.h:

#define SERVER_CONNECTION_TIMEOUT 10 // seconds — TCP connection timeout
#define DAEMON_RESPONSE_TIMEOUT 30 // seconds — default response timeout
#define RECEIVE_BUFFER_SIZE 4096 // bytes
#define SEND_BUFFER_SIZE 4096 // bytes
ConstantValueMeaning
SERVER_CONNECTION_TIMEOUT10 secondsTCP connection timeout
DAEMON_RESPONSE_TIMEOUT30 secondsDefault response timeout used by receive() and fetch()
RECEIVE_BUFFER_SIZE4096 bytesSize of the internal receive buffer
SEND_BUFFER_SIZE4096 bytesSize of the internal send buffer

Config Struct​

Populated automatically during client initialization from the daemon's INIT response.

struct Config {
enum class SystemMode { PULL = 0, PUSH = 1 };
enum class SimulatorMode { SYSTEM_WIDE = 0, PER_NODE = 1 };

SystemMode SYSTEM_MODE;
SimulatorMode SIMULATOR_MODE;
bool USE_DB;
std::string DB_ADDRESS;
int DB_PORT;
int DB_NUM;
};

Accessible via client.cfg after initialization.

Go Deeper​

  • NSBClient — the base class that performs the INIT handshake populating this struct
  • Configuration Reference — the YAML fields these values are sourced from