Only set the send/recv buffer sizes if they have been configured

This commit is contained in:
Robinson 2023-08-10 23:34:27 -06:00
parent 8e7c47abcc
commit 95b1b44890
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 9 additions and 2 deletions

View File

@ -65,8 +65,6 @@ internal class AeronContext(config: Configuration.MediaDriverConfig, logger: KLo
.ipcMtuLength(config.ipcMtuSize)
.initialWindowLength(config.initialWindowLength)
.socketSndbufLength(config.sendBufferSize)
.socketRcvbufLength(config.receiveBufferSize)
.conductorThreadFactory(threadFactory)
.receiverThreadFactory(threadFactory)
@ -74,6 +72,15 @@ internal class AeronContext(config: Configuration.MediaDriverConfig, logger: KLo
.sharedNetworkThreadFactory(threadFactory)
.sharedThreadFactory(threadFactory)
if (config.sendBufferSize > 0) {
mediaDriverContext.socketSndbufLength(config.sendBufferSize)
}
if (config.receiveBufferSize > 0) {
mediaDriverContext.socketRcvbufLength(config.receiveBufferSize)
}
if (config.conductorIdleStrategy != null) {
mediaDriverContext.conductorIdleStrategy(config.conductorIdleStrategy)
}