Cleaned up fragment-limit for poll, added comments
This commit is contained in:
parent
efa032740a
commit
39503ac6d9
|
@ -229,8 +229,11 @@ open class Server<CONNECTION : Connection>(config: ServerConfiguration = ServerC
|
||||||
while (!isShutdown()) {
|
while (!isShutdown()) {
|
||||||
pollCount = 0
|
pollCount = 0
|
||||||
|
|
||||||
|
// NOTE: regarding fragment limit size. Repeated calls to '.poll' will reassemble a fragment.
|
||||||
|
// `.poll(handler, 4)` == `.poll(handler, 2)` + `.poll(handler, 2)`
|
||||||
|
|
||||||
// this checks to see if there are NEW clients on the handshake ports
|
// this checks to see if there are NEW clients on the handshake ports
|
||||||
pollCount += handshakeSubscription.poll(handshakeHandler, 4)
|
pollCount += handshakeSubscription.poll(handshakeHandler, 2)
|
||||||
|
|
||||||
// this checks to see if there are NEW clients via IPC
|
// this checks to see if there are NEW clients via IPC
|
||||||
// pollCount += ipcHandshakeSubscription.poll(ipcInitialConnectionHandler, 100)
|
// pollCount += ipcHandshakeSubscription.poll(ipcInitialConnectionHandler, 100)
|
||||||
|
|
|
@ -191,7 +191,9 @@ open class Connection(connectionParameters: ConnectionParams<*>) {
|
||||||
* Polls the AERON media driver subscription channel for incoming messages
|
* Polls the AERON media driver subscription channel for incoming messages
|
||||||
*/
|
*/
|
||||||
internal fun pollSubscriptions(): Int {
|
internal fun pollSubscriptions(): Int {
|
||||||
return subscription.poll(messageHandler, 4)
|
// NOTE: regarding fragment limit size. Repeated calls to '.poll' will reassemble a fragment.
|
||||||
|
// `.poll(handler, 4)` == `.poll(handler, 2)` + `.poll(handler, 2)`
|
||||||
|
return subscription.poll(messageHandler, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -123,7 +123,9 @@ internal class ClientHandshake<CONNECTION: Connection>(private val logger: KLogg
|
||||||
|
|
||||||
val startTime = System.currentTimeMillis()
|
val startTime = System.currentTimeMillis()
|
||||||
while (System.currentTimeMillis() - startTime < connectionTimeoutMS) {
|
while (System.currentTimeMillis() - startTime < connectionTimeoutMS) {
|
||||||
pollCount = subscription.poll(handler, 1024)
|
// NOTE: regarding fragment limit size. Repeated calls to '.poll' will reassemble a fragment.
|
||||||
|
// `.poll(handler, 4)` == `.poll(handler, 2)` + `.poll(handler, 2)`
|
||||||
|
pollCount = subscription.poll(handler, 2)
|
||||||
|
|
||||||
if (failed != null) {
|
if (failed != null) {
|
||||||
// no longer necessary to hold this connection open
|
// no longer necessary to hold this connection open
|
||||||
|
@ -165,7 +167,9 @@ internal class ClientHandshake<CONNECTION: Connection>(private val logger: KLogg
|
||||||
|
|
||||||
val startTime = System.currentTimeMillis()
|
val startTime = System.currentTimeMillis()
|
||||||
while (System.currentTimeMillis() - startTime < connectionTimeoutMS) {
|
while (System.currentTimeMillis() - startTime < connectionTimeoutMS) {
|
||||||
pollCount = subscription.poll(handler, 1024)
|
// NOTE: regarding fragment limit size. Repeated calls to '.poll' will reassemble a fragment.
|
||||||
|
// `.poll(handler, 4)` == `.poll(handler, 2)` + `.poll(handler, 2)`
|
||||||
|
pollCount = subscription.poll(handler, 2)
|
||||||
|
|
||||||
if (failed != null) {
|
if (failed != null) {
|
||||||
// no longer necessary to hold this connection open
|
// no longer necessary to hold this connection open
|
||||||
|
|
Loading…
Reference in New Issue
Block a user