@Throws(IOException::class) fun createSocket(host: InetAddress?, port: Int): Socket { val socket: Socket = createSocket() connectSocket(socket, InetSocketAddress(host, port)) return socket }
Creates a socket and connect it to the specified remote address on the specified remote port .