NxLibRemote¶
nxLibConnect¶
-
void nxLibConnect(NXLIBERR *result, NXLIBSTR hostname, NXLIBINT portNumber)¶
Connects to an NxLib instance via TCP on the specified host and port. As NxLibRemote has no own tree structure, it is necessary to connect to an NxLib instance. All tree operations such as reads and writes will then be carried out on the tree of the remote NxLib instance. The remote instance must be prepared for the connection by opening a TCP port using
nxLibOpenTcpPort()
.Note
This function is only available in the NxLibRemote Interface. NxLib provides the corresponding functions
nxLibOpenTcpPort()
andnxLibCloseTcpPort()
.- Parameters
result – A pointer to a variable for the return code of the operation. The following return codes can occur:
NxLibOperationSucceeded
- The operation completed successfully. No error occurred.NxLibInvalidParameters
- One, multiple, or a combination of parameters are invalid.NxLibNotConnected
- The connection to the NxLib instance could not be established or the operation could not be performed because there is no connection to any NxLib instance.NxLibInternalError
- An unknown internal error occurred.
hostname – A string specifying a valid DNS host name or IP address.
portNumber – The port number on which the remote NxLib instance listens for connections.
-
static void nxLibConnect(std::string const &hostname, int port)¶
-
Note
C++ only This function is an overload accessible only in C++. Instead of returning the result code as an output parameter like its C counterpart, it throws an NxLibException in case of an error.
nxLibDisconnect¶
-
void nxLibDisconnect(NXLIBERR *result)¶
Disconnects from the NxLib instance, if connected.
- Parameters
result – A pointer to a variable for the return code of the operation. The following return codes can occur:
NxLibOperationSucceeded
- The operation completed successfully. No error occurred.NxLibInternalError
- An unknown internal error occurred.
-
static void nxLibDisconnect()¶
-
Note
C++ only This function is an overload accessible only in C++. Instead of returning the result code as an output parameter like its C counterpart, it throws an NxLibException in case of an error.