TcpSocketBuilder
class TcpSocketBuilder(selector: SelectorManager, var options: SocketOptions) : Configurable<TcpSocketBuilder, SocketOptions>
TCP socket builder
Functions
Link copied to clipboard
fun bind(localAddress: SocketAddress? = null, configure: SocketOptions.AcceptorOptions.() -> Unit = {}): ServerSocket
Bind server socket to listen to localAddress.
fun bind(hostname: String = "0.0.0.0", port: Int = 0, configure: SocketOptions.AcceptorOptions.() -> Unit = {}): ServerSocket
Link copied to clipboard
Configure socket options in block function
Link copied to clipboard
suspend fun connect(remoteAddress: SocketAddress, configure: SocketOptions.TCPClientSocketOptions.() -> Unit = {}): Socket
Connect to remoteAddress.
Link copied to clipboard
suspend fun TcpSocketBuilder.connect(remoteAddress: SocketAddress, configure: SocketOptions.TCPClientSocketOptions.() -> Unit = {}): Socket