Server Handshake has its own dispatcher, and its in the HandshakePollers object

This commit is contained in:
Robinson 2023-09-05 12:58:21 +02:00
parent 1b2487daec
commit effed36faf
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 13 additions and 10 deletions

View File

@ -48,6 +48,11 @@ import java.net.Inet4Address
import java.util.concurrent.*
internal object ServerHandshakePollers {
private val executor = Executors.newSingleThreadExecutor(
NamedThreadFactory("Handshake Dispatcher", Configuration.networkThreadGroup, Thread.NORM_PRIORITY, true)
)
fun disabled(serverInfo: String): AeronPoller {
return object : AeronPoller {
override fun poll(): Int { return 0 }
@ -115,10 +120,8 @@ internal object ServerHandshakePollers {
return
}
// we have read all the data, now dispatch it.
EventDispatcher.HANDSHAKE.launch {
executor.submit {
// HandshakeMessage.HELLO
// HandshakeMessage.DONE
val messageState = message.state
@ -138,7 +141,7 @@ internal object ServerHandshakePollers {
driver.deleteLogFile(image)
server.listenerManager.notifyError(ServerHandshakeException("[$logInfo] Cannot create IPC publication back to client remote process", e))
return@launch
return@submit
}
try {
@ -152,7 +155,7 @@ internal object ServerHandshakePollers {
driver.deleteLogFile(image)
server.listenerManager.notifyError(ServerHandshakeException("[$logInfo] Cannot create IPC publication back to client remote process", e))
return@launch
return@submit
}
@ -192,7 +195,7 @@ internal object ServerHandshakePollers {
driver.deleteLogFile(image)
server.listenerManager.notifyError(ServerHandshakeException("[$logInfo] No publication back to IPC"))
return@launch
return@submit
}
try {
@ -339,7 +342,7 @@ internal object ServerHandshakePollers {
EventDispatcher.HANDSHAKE.launch {
executor.submit {
// HandshakeMessage.HELLO
// HandshakeMessage.DONE
val messageState = message.state
@ -364,7 +367,7 @@ internal object ServerHandshakePollers {
driver.deleteLogFile(image)
server.listenerManager.notifyError(ServerHandshakeException("[$logInfo] Cannot create publication back to $clientAddressString", e))
return@launch
return@submit
}
try {
@ -378,7 +381,7 @@ internal object ServerHandshakePollers {
driver.deleteLogFile(image)
server.listenerManager.notifyError(ServerHandshakeException("[$logInfo] Cannot create publication back to $clientAddressString", e))
return@launch
return@submit
}
try {
@ -427,7 +430,7 @@ internal object ServerHandshakePollers {
driver.deleteLogFile(image)
server.listenerManager.notifyError(ServerHandshakeException("[$logInfo] No publication back to $clientAddressString"))
return@launch
return@submit
}
try {