Skip to main content

NSBClient (Base Class)

Both NSBAppClient and NSBSimClient inherit from NSBClient. You typically do not instantiate this directly.

class NSBClient {
public:
NSBClient(const std::string& identifier, std::string serverAddress, int serverPort);
~NSBClient();

const std::string getId() const; // returns the client identifier
void initialize(); // sends INIT to daemon, receives config
bool ping(); // sends PING, returns true if daemon responds
void exit(); // graceful EXIT message to daemon
};

Method Descriptionsโ€‹

getId()โ€‹

Returns the client identifier passed into the constructor.

initialize()โ€‹

Sends an INIT message to the daemon and receives the system Config struct in response. Called automatically by the NSBAppClient and NSBSimClient constructors โ€” you don't need to call this yourself in normal usage.

ping()โ€‹

Sends a PING message and returns true if the daemon responds. Useful for liveness checks.

exit()โ€‹

Sends a graceful EXIT message to the daemon, signaling disconnection.

Go Deeperโ€‹