blob: bd172013f6deea25956b027611d99dd380fc1bad [file] [log] [blame]
Roman Elizarov1f74a2d2018-06-29 19:19:45 +03001/*
2 * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3 */
4
Sergey Mashkov6ca9a272017-07-25 20:10:27 +03005package kotlinx.coroutines.experimental.io.packet
6
Sergey Mashkovf34175e2017-09-06 22:10:34 +03007import kotlinx.coroutines.experimental.io.internal.*
Sergey Mashkov6d059932017-10-06 18:46:23 +03008import kotlinx.io.core.*
9import kotlinx.io.pool.*
Sergey Mashkov6ca9a272017-07-25 20:10:27 +030010
Sergey Mashkov5feaf692017-09-06 21:50:51 +030011internal val PACKET_BUFFER_SIZE = getIOIntProperty("PacketBufferSize", 4096)
Sergey Mashkov54285652017-09-28 16:55:10 +030012internal val PACKET_BUFFER_POOL_SIZE = getIOIntProperty("PacketBufferPoolSize", 128)
Sergey Mashkov57906eb2017-09-19 14:08:06 +030013internal val PACKET_MAX_COPY_SIZE = getIOIntProperty("PacketMaxCopySize", 500)
Roman Elizarov83762032017-08-08 19:58:40 +030014
Sergey Mashkov6d059932017-10-06 18:46:23 +030015fun WritePacket(headerSizeHint: Int = 0): ByteWritePacket = BytePacketBuilder(headerSizeHint)