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,
sessionId: Int,
) :
MediaDriverConnection(0, 0, streamId, sessionId, 1_000, true) {
MediaDriverConnection(0, 0, streamId, sessionId, 1, true) {
var success: Boolean = false
@ -93,7 +93,7 @@ internal open class IpcMediaDriverConnection(streamId: Int,
success = false
// 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) {
if (publication.isConnected) {
success = true

View File

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