Randomize endpoints in ConnectionStrategy

Fixes #76
This commit is contained in:
Davide De Rosa 2019-03-25 10:21:21 +01:00
parent 7ce31c3184
commit 54a477ce67
1 changed files with 6 additions and 1 deletions

View File

@ -58,7 +58,12 @@ class ConnectionStrategy {
self.hostname = hostname
prefersResolvedAddresses = configuration.prefersResolvedAddresses
resolvedAddresses = configuration.resolvedAddresses
endpointProtocols = configuration.endpointProtocols
if configuration.sessionConfiguration.randomizeEndpoint ?? false {
endpointProtocols = configuration.endpointProtocols.shuffled()
} else {
endpointProtocols = configuration.endpointProtocols
}
}
func createSocket(