Fix sockaddr.sin_family type conversion.

Bump version to 2.1.2.
This commit is contained in:
cheatfate 2018-09-26 21:05:53 +03:00
parent 74054428a4
commit 756f85576e
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
packageName = "asyncdispatch2"
version = "2.1.1"
version = "2.1.2"
author = "Status Research & Development GmbH"
description = "Asyncdispatch2"
license = "Apache License 2.0 or MIT"

View File

@ -389,13 +389,13 @@ when defined(windows):
result = true
if domain == Domain.AF_INET6:
var saddr: Sockaddr_in6
saddr.sin6_family = int16(toInt(domain))
saddr.sin6_family = type(saddr.sin6_family)(toInt(domain))
if bindAddr(SocketHandle(handle), cast[ptr SockAddr](addr(saddr)),
sizeof(saddr).SockLen) != 0'i32:
result = false
else:
var saddr: Sockaddr_in
saddr.sin_family = int16(toInt(domain))
saddr.sin_family = type(saddr.sin_family)(toInt(domain))
if bindAddr(SocketHandle(handle), cast[ptr SockAddr](addr(saddr)),
sizeof(saddr).SockLen) != 0'i32:
result = false