Merge remote-tracking branch 'origin/master'

This commit is contained in:
Robinson 2022-03-15 12:53:53 +01:00
commit 04fa453ff3
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
2 changed files with 6 additions and 4 deletions

View File

@ -30,7 +30,7 @@ internal open class IpcMediaDriverConnection(streamId: Int,
val streamIdSubscription: Int, val streamIdSubscription: Int,
sessionId: Int, sessionId: Int,
) : ) :
MediaDriverConnection(0, 0, streamId, sessionId, 1_000, true) { MediaDriverConnection(0, 0, streamId, sessionId, 1, true) {
var success: Boolean = false var success: Boolean = false
@ -93,7 +93,7 @@ internal open class IpcMediaDriverConnection(streamId: Int,
success = false success = false
// this will wait for the server to acknowledge the connection (all via aeron) // this will wait for the server to acknowledge the connection (all via aeron)
startTime = System.currentTimeMillis() startTime = System.nanoTime()
while (timoutInNanos == 0L || System.nanoTime() - startTime < timoutInNanos) { while (timoutInNanos == 0L || System.nanoTime() - startTime < timoutInNanos) {
if (publication.isConnected) { if (publication.isConnected) {
success = true success = true

View File

@ -245,6 +245,8 @@ class ConnectionFilterTest : BaseTest() {
@Test @Test
fun rejectServerIpc() { fun rejectServerIpc() {
// we do not want to limit loopback addresses! Even with filtering, IPC is always allowed to connect
val serverConnectSuccess = atomic(false) val serverConnectSuccess = atomic(false)
val clientConnectSuccess = atomic(false) val clientConnectSuccess = atomic(false)
@ -291,8 +293,8 @@ class ConnectionFilterTest : BaseTest() {
waitForThreads() waitForThreads()
Assert.assertFalse(serverConnectSuccess.value) Assert.assertTrue(serverConnectSuccess.value)
Assert.assertFalse(clientConnectSuccess.value) Assert.assertTrue(clientConnectSuccess.value)
} }
@Test(expected = ClientException::class) @Test(expected = ClientException::class)