From 708e581c62b3c213a2348855d04180988bcd284d Mon Sep 17 00:00:00 2001 From: cheatfate Date: Thu, 14 Jun 2018 10:15:31 +0300 Subject: [PATCH] One more initTAddress(). --- asyncdispatch2/transports/common.nim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/asyncdispatch2/transports/common.nim b/asyncdispatch2/transports/common.nim index 3f685b9..34952e5 100644 --- a/asyncdispatch2/transports/common.nim +++ b/asyncdispatch2/transports/common.nim @@ -179,6 +179,12 @@ proc initTAddress*(address: string, port: int): TransportAddress = except: raise newException(TransportAddressError, getCurrentException().msg) +proc initTAddress*(address: IpAddress, port: Port): TransportAddress = + ## Initialize ``TransportAddress`` with net.nim ``IpAddress`` and + ## port number ``port``. + result.address = address + result.port = port + proc getAddrInfo(address: string, port: Port, domain: Domain, sockType: SockType = SockType.SOCK_STREAM, protocol: Protocol = Protocol.IPPROTO_TCP): ptr AddrInfo =