ktor-network / io.ktor.network.sockets / SocketOptions / AcceptorOptions

AcceptorOptions

class AcceptorOptions : SocketOptions

TCP server socket options

Properties

backlogSize

var backlogSize: Int

Represents TCP server socket backlog size. When a client attempts to connect, the request is added to the so called backlog until it will be accepted. Once accept() is invoked, a client socket is removed from the backlog. If the backlog is too small, it may overflow and upcoming requests will be rejected by the underlying TCP implementation (usually with RST frame that usually causes "connection reset by peer" error on the opposite side).

Inherited Properties

customOptions

val customOptions: MutableMap<Any, Any?>

reuseAddress

var reuseAddress: Boolean

SO_REUSEADDR option

reusePort

var reusePort: Boolean

SO_REUSEPORT option, may not work with old JDK (will be silently ignored)

typeOfService

var typeOfService: TypeOfService

ToS value, TypeOfService.UNDEFINED by default, may not work with old JDK (will be silently ignored)

Inherited Functions

copyCommon

open fun copyCommon(from: SocketOptions): Unit