Fixes sockets.recvFrom not setting length of data.
This commit is contained in:
parent
92e49aeaaf
commit
d00cb877fd
1 changed files with 2 additions and 1 deletions
|
|
@ -1229,6 +1229,7 @@ proc recvFrom*(socket: TSocket, data: var string, length: int,
|
|||
cast[ptr TSockAddr](addr(sockAddress)), addr(addrLen))
|
||||
|
||||
if result != -1:
|
||||
data.setLen(result)
|
||||
address = $inet_ntoa(sockAddress.sin_addr)
|
||||
port = ntohs(sockAddress.sin_port).TPort
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue