Skip to content

Commit 2e165e3

Browse files
CON-223: Removed max_objects_per_thread API (#60)
* CON-223: Removed max_objects_per_thread API The behaviour of max_objects_per_thread has changed in the core, and it now grows dynamically, meaning we no longer need to provide a way of setting it. * CON-200: Add test * CON-223: Added empty implementation of deprecated API Co-authored-by: Sam Raeburn <sam@rti.com>
1 parent 203f34a commit 2e165e3

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

rticonnextdds-connector.js

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ class _ConnectorBinding {
135135
RTI_Connector_get_last_error_message: ['char *', []],
136136
RTI_Connector_get_native_instance: ['int', ['pointer', 'string', ref.refType('pointer')]],
137137
RTI_Connector_free_string: ['void', ['char *']],
138-
RTI_Connector_set_max_objects_per_thread: ['int', ['int']],
139138
RTIDDSConnector_getJSONInstance:['char *', ['pointer', 'string']],
140139
// This API is only used in the unit tests
141140
RTI_Connector_create_test_scenario: ['int', ['pointer', 'int', 'pointer']]
@@ -2046,26 +2045,15 @@ class Connector extends EventEmitter {
20462045
}
20472046

20482047
/**
2049-
* Allows you to increase the number of :class:`Connector` instances that
2050-
* can be created.
2048+
* This method is deprecated since the max_objects_per_thread now grows
2049+
* dynamically.
20512050
*
2052-
* The default value is 2048 (which allows for approximately 15 instances
2053-
* of :class:`Connector` to be created in a single application). If you need
2054-
* to create more than 8 instances of :class:`Connector`, you can increase
2055-
* the value from the default.
2056-
*
2057-
* .. note::
2058-
* This is a static method. It can only be called before creating a
2059-
* :class:`Connector` instance.
2060-
*
2061-
* See `SYSTEM_RESOURCE_LIMITS QoS Policy
2062-
* <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/users_manual/index.htm#users_manual/SYSTEM_RESOURCE_LIMITS_QoS.htm>`__
2063-
* in the *RTI Connext DDS Core Libraries User's Manual* for more information.
2051+
* @private
20642052
*
2065-
* @param {number} value The value for ``max_objects_per_thread``
2053+
* Note this method is deprecated in the Ironside release. This static method
2054+
* only exists to not break user's applications which are already using it.
20662055
*/
20672056
static setMaxObjectsPerThread (value) {
2068-
_checkRetcode(connectorBinding.api.RTI_Connector_set_max_objects_per_thread(value))
20692057
}
20702058
}
20712059

test/nodejs/test_rticonnextdds_connector.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ describe('Connector Tests', function () {
101101
expect(connector).to.be.instanceOf(rti.Connector)
102102
})
103103

104+
// Test for CON-200
105+
it('Connector should not segfault if deleted twice', async function () {
106+
const xmlProfile1 = path.join(__dirname, '/../xml/TestConnector.xml')
107+
const xmlProfile2 = path.join(__dirname, '/../xml/TestConnector2.xml')
108+
const fullXmlPath = xmlProfile1 + ';' + xmlProfile2
109+
const connector = new rti.Connector('MyParticipantLibrary2::MyParticipant2', fullXmlPath)
110+
expect(connector).to.exist
111+
expect(connector).to.be.instanceOf(rti.Connector)
112+
await connector.close()
113+
await connector.close()
114+
})
115+
104116
describe('Connector callback test', function () {
105117
let connector
106118

0 commit comments

Comments
 (0)