Add some deprecation routines.
This commit is contained in:
parent
774269f2f0
commit
02c27c95a1
|
@ -9,6 +9,7 @@
|
|||
from net import IpAddressFamily, IpAddress, `$`, parseIpAddress
|
||||
import os, strutils, nativesockets
|
||||
import ../asyncloop
|
||||
export IpAddressFamily
|
||||
|
||||
when defined(windows):
|
||||
import winlean
|
||||
|
@ -425,6 +426,22 @@ proc resolveTAddress*(address: string, port: Port,
|
|||
it = it.ai_next
|
||||
freeAddrInfo(aiList)
|
||||
|
||||
proc resolveTAddress*(address: string,
|
||||
family: IpAddressFamily): seq[TransportAddress] {.
|
||||
deprecated.} =
|
||||
if family == IpAddressFamily.IPv4:
|
||||
result = resolveTAddress(address, AddressFamily.IPv4)
|
||||
elif family == IpAddressFamily.IPv6:
|
||||
result = resolveTAddress(address, AddressFamily.IPv6)
|
||||
|
||||
proc resolveTAddress*(address: string, port: Port,
|
||||
family: IpAddressFamily): seq[TransportAddress] {.
|
||||
deprecated.} =
|
||||
if family == IpAddressFamily.IPv4:
|
||||
result = resolveTAddress(address, port, AddressFamily.IPv4)
|
||||
elif family == IpAddressFamily.IPv6:
|
||||
result = resolveTAddress(address, port, AddressFamily.IPv6)
|
||||
|
||||
template checkClosed*(t: untyped) =
|
||||
if (ReadClosed in (t).state) or (WriteClosed in (t).state):
|
||||
raise newException(TransportError, "Transport is already closed!")
|
||||
|
|
Loading…
Reference in New Issue