3. RDMAConnection Base Class#
RDMAConnection is the public base class used by cuObjServer.
Applications should normally construct and use cuObjServer directly.
3.1. Class Declaration#
class RDMAConnection {
public:
cuObjRDMATunable params;
RDMAConnection(const char* ip, unsigned short port);
RDMAConnection(const RDMAConnection&) = delete;
RDMAConnection& operator=(const RDMAConnection&) = delete;
RDMAConnection(RDMAConnection&&) = delete;
RDMAConnection& operator=(RDMAConnection&&) = delete;
~RDMAConnection();
int startRDMASession();
void initRDMAConfigParams(cuObjRDMATunable config_params);
void closeRDMASession();
void handleDisconnectEvent(struct rdma_cm_id* id);
char* getChannelIP(struct rdma_cm_id* id);
int getChannelPort(struct rdma_cm_id* id);
void getConfigTunableParam(struct cuObjRDMATunableParam* param);
};
3.2. RDMAConnection(const char* ip, unsigned short port)#
Initializes address state for a server endpoint.
Parameters:
ip: Server endpoint address string. IPv4 and IPv6 address strings are supported.port: Server port.
Notes:
The constructor stores address state. The RDMA session is started by
startRDMASession(), whichcuObjServercalls during construction.Invalid address strings are marked invalid and cause
startRDMASession()to fail.Copy and move construction and assignment are deleted.
3.3. startRDMASession()#
int startRDMASession();
Returns:
0on success.-1if the address is invalid or the RDMA session cannot be opened.
3.4. initRDMAConfigParams()#
void initRDMAConfigParams(cuObjRDMATunable config_params);
Copies tunable values into the connection object. This API does not return a status value.
3.5. closeRDMASession()#
void closeRDMASession();
Closes the RDMA session if one is open. This API does not return a status value.
3.6. handleDisconnectEvent()#
void handleDisconnectEvent(struct rdma_cm_id* id);
This method is declared in the public header but is not documented as an
application-facing cuObjServer operation. Applications should not call it
directly.
3.7. getChannelIP()#
char* getChannelIP(struct rdma_cm_id* id);
Returns a string representation of the channel IP address. IPv4 and IPv6 addresses are returned in text form. The returned pointer refers to static storage owned by the library.
3.8. getChannelPort()#
int getChannelPort(struct rdma_cm_id* id);
Returns the channel source port.
3.9. getConfigTunableParam()#
void getConfigTunableParam(struct cuObjRDMATunableParam* param);
Copies the current tunable values into param. param must be non-null.