renamed function: isConnected -> isClosedWithTimeout
This commit is contained in:
parent
d51c878a65
commit
7cacc63dca
|
@ -831,7 +831,7 @@ open class Client<CONNECTION : Connection>(config: ClientConfiguration = ClientC
|
|||
override fun invoke(): Int {
|
||||
// if we initiate a disconnect manually, then there is no need to wait for aeron to verify it's closed
|
||||
// we only want to wait for aeron to verify it's closed if we are SUPPOSED to be connected, but there's a network blip
|
||||
return if (!(shutdownEventPoller || newConnection.isClosed() || newConnection.isConnected())) {
|
||||
return if (!(shutdownEventPoller || newConnection.isClosed() || newConnection.isClosedWithTimeout())) {
|
||||
newConnection.poll()
|
||||
} else {
|
||||
// If the connection has either been closed, or has expired, it needs to be cleaned-up/deleted.
|
||||
|
|
|
@ -230,7 +230,7 @@ open class Server<CONNECTION : Connection>(config: ServerConfiguration = ServerC
|
|||
// this manages existing clients (for cleanup + connection polling). This has a concurrent iterator,
|
||||
// so we can modify this as we go
|
||||
connections.forEach { connection ->
|
||||
if (!(connection.isClosed() || connection.isConnected()) ) {
|
||||
if (!(connection.isClosed() || connection.isClosedWithTimeout()) ) {
|
||||
// Otherwise, poll the connection for messages
|
||||
pollCount += connection.poll()
|
||||
} else {
|
||||
|
|
|
@ -290,7 +290,7 @@ open class Connection(connectionParameters: ConnectionParams<*>) {
|
|||
*
|
||||
* @return `true` if this connection has been closed via aeron
|
||||
*/
|
||||
fun isConnected(): Boolean {
|
||||
fun isClosedWithTimeout(): Boolean {
|
||||
// we ONLY want to actually, legit check, 1 time every XXX ms.
|
||||
val now = System.nanoTime()
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ open class Session<CONNECTION: SessionConnection>(@Volatile var connection: CONN
|
|||
pendingMessagesQueue.put(message)
|
||||
connection.logger.error("[{}] queueing message", connection)
|
||||
}
|
||||
else if (!connection.isConnected()) {
|
||||
else if (!connection.isClosedWithTimeout()) {
|
||||
// there was an issue - the connection should automatically reconnect
|
||||
pendingMessagesQueue.put(message)
|
||||
connection.logger.error("[{}] queueing message", connection)
|
||||
|
|
Loading…
Reference in New Issue