ResponseManager now uses a special TimeoutException instead of generic exception.

This commit is contained in:
Robinson 2023-10-18 19:47:02 +02:00
parent 46cb174183
commit 2a8ac38e55
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
2 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,21 @@
/*
* Copyright 2023 dorkbox, llc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dorkbox.network.exceptions
class TimeoutException: Exception() {
}

View File

@ -38,7 +38,7 @@ import kotlin.concurrent.write
*/
internal class ResponseManager(maxValuesInCache: Int = 65534, minimumValue: Int = 2) {
companion object {
val TIMEOUT_EXCEPTION = Exception().apply { stackTrace = arrayOf<StackTraceElement>() }
val TIMEOUT_EXCEPTION = TimeoutException().apply { stackTrace = arrayOf<StackTraceElement>() }
}
private val rmiWaitersInUse = atomic(0)