From 78e946c4509d9cf02f8508f82dd6daf1fbc168cf Mon Sep 17 00:00:00 2001 From: David Krause Date: Wed, 2 May 2018 23:44:08 +0200 Subject: [PATCH] fixed high level sendTo for sending to udp6 (#7630) --- lib/pure/net.nim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/pure/net.nim b/lib/pure/net.nim index ebb59ca6d..e522d86fe 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -1421,8 +1421,7 @@ proc sendTo*(socket: Socket, address: string, port: Port, data: pointer, ## ## **Note:** This proc is not available for SSL sockets. assert(not socket.isClosed, "Cannot `sendTo` on a closed socket") - var aiList = getAddrInfo(address, port, af) - + var aiList = getAddrInfo(address, port, af, socket.sockType, socket.protocol) # try all possibilities: var success = false var it = aiList @@ -1443,7 +1442,7 @@ proc sendTo*(socket: Socket, address: string, port: Port, ## this function will try each IP of that hostname. ## ## This is the high-level version of the above ``sendTo`` function. - result = socket.sendTo(address, port, cstring(data), data.len) + result = socket.sendTo(address, port, cstring(data), data.len, socket.domain ) proc isSsl*(socket: Socket): bool =