mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
fixed high level sendTo for sending to udp6 (#7630)
This commit is contained in:
committed by
Dominik Picheta
parent
452321874d
commit
78e946c450
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user