SokDoc

sok / Sok.Socket.TCP / createTCPClientSocket

createTCPClientSocket

suspend expect fun createTCPClientSocket(address: String, port: Int): TCPClientSocket (source)

Create a client socket with the given address and port. This function will throw a ConnectionRefusedException if the socket failed to connect.

Parameters

address - IP or domain to connect to

port - port to connect to

Return connected socket