code cleanup
This commit is contained in:
parent
167de54114
commit
cf875832d9
@ -376,7 +376,8 @@ open class Server<CONNECTION : Connection>(
|
|||||||
// finish closing -- this lets us make sure that we don't run into race conditions on the thread that calls close()
|
// finish closing -- this lets us make sure that we don't run into race conditions on the thread that calls close()
|
||||||
try {
|
try {
|
||||||
shutdownEventLatch.countDown()
|
shutdownEventLatch.countDown()
|
||||||
} catch (ignored: Exception) {}
|
} catch (ignored: Exception) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -409,9 +410,11 @@ open class Server<CONNECTION : Connection>(
|
|||||||
*
|
*
|
||||||
* This function will be called for **only** network clients (IPC client are excluded)
|
* This function will be called for **only** network clients (IPC client are excluded)
|
||||||
*/
|
*/
|
||||||
fun filter(ipFilterRule: IpFilterRule) = runBlocking {
|
fun filter(ipFilterRule: IpFilterRule) {
|
||||||
|
runBlocking {
|
||||||
listenerManager.filter(ipFilterRule)
|
listenerManager.filter(ipFilterRule)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a function that will be called BEFORE a client/server "connects" with each other, and used to determine if a connection
|
* Adds a function that will be called BEFORE a client/server "connects" with each other, and used to determine if a connection
|
||||||
@ -431,9 +434,11 @@ open class Server<CONNECTION : Connection>(
|
|||||||
*
|
*
|
||||||
* This function will be called for **only** network clients (IPC client are excluded)
|
* This function will be called for **only** network clients (IPC client are excluded)
|
||||||
*/
|
*/
|
||||||
fun filter(function: CONNECTION.() -> Boolean) = runBlocking {
|
fun filter(function: CONNECTION.() -> Boolean) {
|
||||||
|
runBlocking {
|
||||||
listenerManager.filter(function)
|
listenerManager.filter(function)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs an action for each connection
|
* Runs an action for each connection
|
||||||
|
Loading…
Reference in New Issue
Block a user