aboutsummaryrefslogtreecommitdiff
path: root/shard/lib/net/group.ex
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-10-12 22:39:38 +0200
committerAlex Auvolat <alex@adnab.me>2018-10-12 22:39:38 +0200
commit0ed802601812acd6ad764e6ffd5aacfd7e674553 (patch)
tree1b7fccb7fbf81a6822dd3313f00a940e441b90ed /shard/lib/net/group.ex
parenteab3f9483b3659b1ad3572393d24652cac71c8b6 (diff)
downloadshard-0ed802601812acd6ad764e6ffd5aacfd7e674553.tar.gz
shard-0ed802601812acd6ad764e6ffd5aacfd7e674553.zip
Connection management improvement, stuff
Diffstat (limited to 'shard/lib/net/group.ex')
-rw-r--r--shard/lib/net/group.ex6
1 files changed, 3 insertions, 3 deletions
diff --git a/shard/lib/net/group.ex b/shard/lib/net/group.ex
index 3cce22a..a5f0867 100644
--- a/shard/lib/net/group.ex
+++ b/shard/lib/net/group.ex
@@ -36,7 +36,7 @@ defmodule SNet.PubShardGroup do
def init_lookup(%SNet.PubShardGroup{id: id}, notify_to) do
# For now: ask all currently connected peers and connect to new peers we know of
spawn fn ->
- for {_, pid, _} <- SNet.Manager.list_connections do
+ for {_, pid, _, _} <- SNet.Manager.list_connections do
GenServer.cast(notify_to, {:peer_connected, pid})
end
for peer_info <- Shard.Manager.get_shard_peers id do
@@ -91,7 +91,7 @@ defmodule SNet.PrivGroup do
def init_lookup(%SNet.PrivGroup{pk_list: pk_list}, notify_to) do
spawn fn ->
# 1. We might already have some connections to these guys
- for {_, pid, %SNet.Auth{my_pk: my_pk, his_pk: his_pk}} <- SNet.Manager.list_connections do
+ for {_, pid, %SNet.Auth{my_pk: my_pk, his_pk: his_pk}, _} <- SNet.Manager.list_connections do
if (my_pk in pk_list) and (his_pk in pk_list) do
GenServer.cast(notify_to, {:peer_connected, pid})
end
@@ -115,7 +115,7 @@ defmodule SNet.PrivGroup do
end
def get_connections(%SNet.PrivGroup{pk_list: pk_list}) do
- for {_, pid, %SNet.Auth{my_pk: my_pk, his_pk: his_pk}} <- SNet.Manager.list_connections,
+ for {_, pid, %SNet.Auth{my_pk: my_pk, his_pk: his_pk}, _} <- SNet.Manager.list_connections,
(my_pk in pk_list) and (his_pk in pk_list),
do: pid
end