UDP frame size information moved to startup.

This commit is contained in:
Robinson 2023-08-21 19:52:19 +02:00
parent 0747802f0d
commit b639ec1372
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 2 additions and 1 deletions

View File

@ -454,6 +454,8 @@ open class Serialization<CONNECTION: Connection>(private val references: Boolean
logger = KotlinLogging.logger(type.simpleName)
this.maxMessageSize = maxMessageSize
logger.info { "UDP frame size: $maxMessageSize" }
val firstInitialization = initialized.compareAndSet(expect = false, update = true)
if (type == Server::class.java) {
@ -790,7 +792,6 @@ open class Serialization<CONNECTION: Connection>(private val references: Boolean
* @return takes a kryo instance from the pool, or creates one if the pool was empty
*/
private fun newWriteKryo(): KryoWriter<CONNECTION> {
logger.debug { "Creating new Kryo($maxMessageSize)" }
val kryo = KryoWriter<CONNECTION>(maxMessageSize)
newGlobalKryo(kryo)