More specific variable name for ipv4 check

This commit is contained in:
Robinson 2022-08-20 11:10:19 +02:00
parent 5472a07079
commit 77701e12c4
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
3 changed files with 10 additions and 9 deletions

View File

@ -47,7 +47,7 @@ internal open class ServerUdpDriver(val listenAddress: InetAddress,
var success: Boolean = false
override val type = "udp"
private val isIpv4 = listenAddress is Inet4Address
private val isListenIpv4 = listenAddress is Inet4Address
protected val listenAddressString = IP.toString(listenAddress)
protected val prettyAddressString = when (listenAddress) {
@ -59,10 +59,10 @@ internal open class ServerUdpDriver(val listenAddress: InetAddress,
override fun build(aeronDriver: AeronDriver, logger: KLogger) {
// Create a subscription at the given address and port, using the given stream ID.
val subscriptionUri = uri("udp", sessionId, isReliable).endpoint(isIpv4, listenAddressString, port)
val subscriptionUri = uri("udp", sessionId, isReliable).endpoint(isListenIpv4, listenAddressString, port)
if (logger.isTraceEnabled) {
if (isIpv4) {
if (isListenIpv4) {
logger.trace("IPV4 server sub URI: ${subscriptionUri.build()},stream-id=$streamId")
} else {
logger.trace("IPV6 server sub URI: ${subscriptionUri.build()},stream-id=$streamId")

View File

@ -111,8 +111,8 @@ object AeronClient {
configuration.port = 2000
configuration.enableIpc = false
configuration.enableIPv4 = false
// configuration.enableIPv6 = false
configuration.enableIPv4 = true
configuration.enableIPv6 = false
configuration.uniqueAeronDirectory = true

View File

@ -88,14 +88,15 @@ object AeronServer {
fun main(args: Array<String>) {
val configuration = ServerConfiguration()
configuration.settingsStore = Storage.Memory() // don't want to persist anything on disk!
configuration.listenIpAddress = "127.0.0.1"
configuration.listenIpAddress = "*"
// configuration.listenIpAddress = "127.0.0.1"
configuration.port = 2000
configuration.maxClientCount = 50
configuration.enableIpc = true
// configuration.enableIpc = true
configuration.enableIpc = false
configuration.enableIPv4 = false
// configuration.enableIPv6 = false
configuration.enableIPv4 = true
configuration.enableIPv6 = true
configuration.maxConnectionsPerIpAddress = 50