Allow to setup datagram servers with 0 port.

This commit is contained in:
cheatfate 2020-01-28 15:46:57 +02:00
parent e34857364e
commit 4a2416fe5e
No known key found for this signature in database
GPG Key ID: 46ADD633A7201F95
1 changed files with 1 additions and 2 deletions

View File

@ -536,7 +536,7 @@ else:
closeSocket(localSock)
raiseTransportOsError(err)
if local.port != Port(0):
if local.family != AddressFamily.None:
var saddr: Sockaddr_storage
var slen: SockLen
toSAddr(local, saddr, slen)
@ -546,7 +546,6 @@ else:
if sock == asyncInvalidSocket:
closeSocket(localSock)
raiseTransportOsError(err)
result.local = local
if remote.port != Port(0):
var saddr: Sockaddr_storage