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