fixed high level sendTo for sending to udp6 (#7630)
This commit is contained in:
parent
452321874d
commit
78e946c450
1 changed files with 2 additions and 3 deletions
|
|
@ -1421,8 +1421,7 @@ proc sendTo*(socket: Socket, address: string, port: Port, data: pointer,
|
||||||
##
|
##
|
||||||
## **Note:** This proc is not available for SSL sockets.
|
## **Note:** This proc is not available for SSL sockets.
|
||||||
assert(not socket.isClosed, "Cannot `sendTo` on a closed socket")
|
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:
|
# try all possibilities:
|
||||||
var success = false
|
var success = false
|
||||||
var it = aiList
|
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 function will try each IP of that hostname.
|
||||||
##
|
##
|
||||||
## This is the high-level version of the above ``sendTo`` function.
|
## 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 =
|
proc isSsl*(socket: Socket): bool =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue