Add one_to_all_connect

This commit is contained in:
NIC619 2019-07-18 19:39:57 +08:00
parent 404dc67e83
commit a26c7783d6
No known key found for this signature in database
GPG Key ID: 570C35F5C2D51B17

View File

@ -122,3 +122,8 @@ async def connect_some(hosts, degree):
# await connect(host, neighbor)
# j += 1
async def one_to_all_connect(hosts, central_host_index):
for i, host in enumerate(hosts):
if i != central_host_index:
await connect(hosts[central_host_index], host)